Commit 102dad49 authored by Florian Pritz's avatar Florian Pritz Committed by Lukas Fleischer
Browse files

schema: Fix invalid NULL on primary key

>From the mysql 5.7 breaking change page:

Columns in a PRIMARY KEY must be NOT NULL, but if declared explicitly as
NULL produced no error. Now an error occurs. For example, a statement
such as CREATE TABLE t (i INT NULL PRIMARY KEY) is rejected. The same
occurs for similar ALTER TABLE statements. (Bug #13995622, Bug #66987,
Bug #15967545, Bug #16545198)

References:
http://stackoverflow.com/a/22314073



Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 09cb61ab
...@@ -373,7 +373,7 @@ CREATE TABLE IF NOT EXISTS TU_Votes ( ...@@ -373,7 +373,7 @@ CREATE TABLE IF NOT EXISTS TU_Votes (
-- Malicious user banning -- Malicious user banning
-- --
CREATE TABLE Bans ( CREATE TABLE Bans (
IPAddress VARCHAR(45) NULL DEFAULT NULL, IPAddress VARCHAR(45) NOT NULL,
BanTS TIMESTAMP NOT NULL, BanTS TIMESTAMP NOT NULL,
PRIMARY KEY (IPAddress) PRIMARY KEY (IPAddress)
) ENGINE = InnoDB; ) ENGINE = InnoDB;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment