From 421f86d8a303559151329eb5737b0f652347b068 Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Sat, 5 Dec 2015 14:24:38 +0100 Subject: [PATCH] UrlNaming - Increase size of poll's id column --- admin/migration.php | 2 + .../Migration/Increase_pollId_size.php | 46 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 app/classes/Framadate/Migration/Increase_pollId_size.php diff --git a/admin/migration.php b/admin/migration.php index ad58d66..cf8f8f9 100644 --- a/admin/migration.php +++ b/admin/migration.php @@ -26,6 +26,7 @@ use Framadate\Migration\Alter_Comment_table_for_name_length; use Framadate\Migration\Alter_Comment_table_adding_date; use Framadate\Migration\Generate_uniqId_for_old_votes; use Framadate\Migration\AddColumns_password_hash_And_results_publicly_visible_In_poll_For_0_9; +use Framadate\Migration\Increase_pollId_size; use Framadate\Migration\Migration; use Framadate\Migration\RPadVotes_from_0_8; use Framadate\Utils; @@ -46,6 +47,7 @@ $migrations = [ new Alter_Comment_table_for_name_length(), new Alter_Comment_table_adding_date(), new AddColumns_password_hash_And_results_publicly_visible_In_poll_For_0_9(), + new Increase_pollId_size() ]; // --------------------------------------- diff --git a/app/classes/Framadate/Migration/Increase_pollId_size.php b/app/classes/Framadate/Migration/Increase_pollId_size.php new file mode 100644 index 0000000..80fb500 --- /dev/null +++ b/app/classes/Framadate/Migration/Increase_pollId_size.php @@ -0,0 +1,46 @@ +alterPollTable($pdo); + } + + private function alterPollTable(\PDO $pdo) { + $pdo->exec(' + ALTER TABLE `' . Utils::table('poll') . '` + CHANGE `id` `id` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;'); + } +}