diff --git a/admin/migration.php b/admin/migration.php index 9eceac0..978e690 100644 --- a/admin/migration.php +++ b/admin/migration.php @@ -23,6 +23,7 @@ use Framadate\Migration\AddColumn_receiveNewComments_For_0_9; use Framadate\Migration\AddColumn_uniqId_In_vote_For_0_9; use Framadate\Migration\AddColumn_hidden_In_poll_For_0_9; use Framadate\Migration\Alter_Comment_table_for_name_length; +use Framadate\Migration\Alter_Comment_table_adding_date; use Framadate\Migration\Migration; use Framadate\Utils; @@ -38,6 +39,7 @@ $migrations = [ new AddColumn_uniqId_In_vote_For_0_9(), new AddColumn_hidden_In_poll_For_0_9(), new Alter_Comment_table_for_name_length(), + new Alter_Comment_table_adding_date(), ]; // --------------------------------------- diff --git a/app/classes/Framadate/Migration/Alter_Comment_table_adding_date.php b/app/classes/Framadate/Migration/Alter_Comment_table_adding_date.php new file mode 100644 index 0000000..fd3d34e --- /dev/null +++ b/app/classes/Framadate/Migration/Alter_Comment_table_adding_date.php @@ -0,0 +1,72 @@ +alterCommentTable($pdo); + + return true; + } + + private function alterCommentTable(\PDO $pdo) { + $pdo->exec(' + ALTER TABLE `' . Utils::table('comment') . '` + ADD `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;'); + } + +}