From 7a54ca865893ac4b113c298047faa93329f2d303 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Tue, 16 Sep 2014 22:43:36 +0200 Subject: [PATCH] Fixing the database migration system for issue #206 --- code/web/private_php/setup/sql/nel_00001.sql | 2 +- code/web/private_php/setup/sql/nel_00004.sql | 1 + code/web/private_php/setup/sql/nel_ams_00001.sql | 2 +- code/web/private_php/setup/sql/nel_ams_00002.sql | 1 + code/web/public_php/ams/sql/db.sql | 2 +- code/web/public_php/setup/database.php | 4 ++-- 6 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 code/web/private_php/setup/sql/nel_00004.sql create mode 100644 code/web/private_php/setup/sql/nel_ams_00002.sql diff --git a/code/web/private_php/setup/sql/nel_00001.sql b/code/web/private_php/setup/sql/nel_00001.sql index 15743b1b9..70e14419b 100644 --- a/code/web/private_php/setup/sql/nel_00001.sql +++ b/code/web/private_php/setup/sql/nel_00001.sql @@ -87,7 +87,7 @@ CREATE TABLE IF NOT EXISTS `shard` ( CREATE TABLE IF NOT EXISTS `user` ( `UId` int(10) NOT NULL, `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(106) DEFAULT NULL, + `Password` varchar(13) DEFAULT NULL, `ShardId` int(10) NOT NULL DEFAULT '-1', `State` enum('Offline','Online') NOT NULL DEFAULT 'Offline', `Privilege` varchar(255) NOT NULL DEFAULT '', diff --git a/code/web/private_php/setup/sql/nel_00004.sql b/code/web/private_php/setup/sql/nel_00004.sql new file mode 100644 index 000000000..8d48a4c8c --- /dev/null +++ b/code/web/private_php/setup/sql/nel_00004.sql @@ -0,0 +1 @@ +ALTER TABLE `user` MODIFY `Password` VARCHAR(106); diff --git a/code/web/private_php/setup/sql/nel_ams_00001.sql b/code/web/private_php/setup/sql/nel_ams_00001.sql index 38085bc1f..c2b0a8895 100644 --- a/code/web/private_php/setup/sql/nel_ams_00001.sql +++ b/code/web/private_php/setup/sql/nel_ams_00001.sql @@ -29,7 +29,7 @@ SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `ams_user` ( `UId` int(10) NOT NULL, `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(106) DEFAULT NULL, + `Password` varchar(13) DEFAULT NULL, `Email` varchar(255) NOT NULL DEFAULT '', `Permission` int(3) NOT NULL DEFAULT '1', `FirstName` varchar(255) NOT NULL DEFAULT '', diff --git a/code/web/private_php/setup/sql/nel_ams_00002.sql b/code/web/private_php/setup/sql/nel_ams_00002.sql new file mode 100644 index 000000000..b1a9c9df4 --- /dev/null +++ b/code/web/private_php/setup/sql/nel_ams_00002.sql @@ -0,0 +1 @@ +ALTER TABLE `ams_user` MODIFY `Password` VARCHAR(106); diff --git a/code/web/public_php/ams/sql/db.sql b/code/web/public_php/ams/sql/db.sql index 6620a9856..b52ae65ed 100644 --- a/code/web/public_php/ams/sql/db.sql +++ b/code/web/public_php/ams/sql/db.sql @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS ams_user; CREATE TABLE IF NOT EXISTS `ams_user` ( `UId` int(10) NOT NULL AUTO_INCREMENT, `Login` varchar(64) NOT NULL DEFAULT '', - `Password` varchar(106) DEFAULT NULL, + `Password` varchar(13) DEFAULT NULL, `Email` varchar(255) NOT NULL DEFAULT '', `Permission` int(3) NOT NULL DEFAULT 1, PRIMARY KEY (`UId`) diff --git a/code/web/public_php/setup/database.php b/code/web/public_php/setup/database.php index 6a1b836ea..3e195f2b8 100644 --- a/code/web/public_php/setup/database.php +++ b/code/web/public_php/setup/database.php @@ -1,11 +1,11 @@