Created
April 27, 2017 09:27
-
-
Save violetyk/b87b12f59bb4bbaf7710b6dd5cad1866 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CREATE TABLE `samples` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`comment` varchar(255) NOT NULL, | |
`created` datetime NOT NULL, | |
PRIMARY KEY (`id`,`created`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 | |
PARTITION BY RANGE COLUMNS(`created`) ( | |
PARTITION samples_p20170427 VALUES LESS THAN('2017-04-28 00:00:00'), | |
PARTITION samples_p20170428 VALUES LESS THAN('2017-04-29 00:00:00') | |
); | |
-- ALTER TABLE `samples` | |
-- PARTITION BY RANGE COLUMNS(`created`) ( | |
-- PARTITION samples_p20170429 VALUES LESS THAN('2017-04-30 00:00:00') | |
-- ); | |
ALTER TABLE `samples` ADD PARTITION ( | |
PARTITION samples_p20170430 VALUES LESS THAN('2017-05-01 00:00:00') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment