Created
February 28, 2018 10:30
-
-
Save luniki/2ca12e4c79a3f57919dc88e3e6acf31b to your computer and use it in GitHub Desktop.
CliqrPlugin timestamp Migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE etask_tasks ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`; | |
UPDATE etask_tasks SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed); | |
ALTER TABLE etask_tasks DROP `created`, DROP `changed`; | |
ALTER TABLE etask_tests ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`; | |
UPDATE etask_tests SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed); | |
ALTER TABLE etask_tests DROP `created`, DROP `changed`; | |
ALTER TABLE etask_responses ADD `mkdate` INT(11) NOT NULL AFTER `created`, ADD `chdate` INT(11) NOT NULL AFTER `changed`; | |
UPDATE etask_responses SET mkdate = UNIX_TIMESTAMP(created), chdate = UNIX_TIMESTAMP(changed); | |
ALTER TABLE etask_responses DROP `created`, DROP `changed`; | |
ALTER TABLE etask_assignments CHANGE `start` `start_old` TIMESTAMP NULL, CHANGE `end` `end_old` TIMESTAMP NULL; | |
ALTER TABLE etask_assignments ADD `start` INT(11) NOT NULL AFTER `start_old`, ADD `end` INT(11) NOT NULL AFTER `end_old`; | |
UPDATE etask_assignments SET start = UNIX_TIMESTAMP(start_old), end = UNIX_TIMESTAMP(end_old); | |
ALTER TABLE etask_assignments DROP `start_old`, DROP `end_old`; | |
ALTER TABLE etask_assignment_attempts CHANGE `start` `start_old` TIMESTAMP NULL, CHANGE `end` `end_old` TIMESTAMP NULL; | |
ALTER TABLE etask_assignment_attempts ADD `start` INT(11) NOT NULL AFTER `start_old`, ADD `end` INT(11) NOT NULL AFTER `end_old`; | |
UPDATE etask_assignment_attempts SET start = UNIX_TIMESTAMP(start_old), end = UNIX_TIMESTAMP(end_old); | |
ALTER TABLE etask_assignment_attempts DROP `start_old`, DROP `end_old`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment