From 62db99252e433ca03bd9a59c18788cd1645e786d Mon Sep 17 00:00:00 2001 From: Miguel Reboiro-Jato Date: Mon, 29 Feb 2016 19:01:59 +0100 Subject: [PATCH] Fixes column nullability in MySQL scripts Some columns of the MySQL database created by the scripts in the "db" directory where incorrectly set as nullable. This commit fixes this error and sets them as non nullable columns. --- db/mysql-with-inserts.sql | 6 +++--- db/mysql.sql | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/mysql-with-inserts.sql b/db/mysql-with-inserts.sql index 7c0a69c..088d807 100644 --- a/db/mysql-with-inserts.sql +++ b/db/mysql-with-inserts.sql @@ -2,14 +2,14 @@ CREATE DATABASE `daaexample`; CREATE TABLE `daaexample`.`people` ( `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(50) DEFAULT NULL, - `surname` varchar(100) DEFAULT NULL, + `name` varchar(50) NOT NULL, + `surname` varchar(100) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `daaexample`.`users` ( `login` varchar(100) NOT NULL, - `password` varchar(64) DEFAULT NULL, + `password` varchar(64) NOT NULL, PRIMARY KEY (`login`) ); diff --git a/db/mysql.sql b/db/mysql.sql index a7d1c3e..136d894 100644 --- a/db/mysql.sql +++ b/db/mysql.sql @@ -2,15 +2,15 @@ CREATE DATABASE `daaexample`; CREATE TABLE `daaexample`.`people` ( `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(50) DEFAULT NULL, - `surname` varchar(100) DEFAULT NULL, + `name` varchar(50) NOT NULL, + `surname` varchar(100) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `daaexample`.`users` ( `login` varchar(100) NOT NULL, - `password` varchar(64) DEFAULT NULL, + `password` varchar(64) NOT NULL, PRIMARY KEY (`login`) ); -GRANT ALL ON `daaexample`.* TO 'daa'@'localhost' IDENTIFIED BY 'daa'; \ No newline at end of file +GRANT ALL ON `daaexample`.* TO 'daa'@'localhost' IDENTIFIED BY 'daa'; -- 2.18.1