...
1-- +migrate Up
2-- SQL in section 'Up' is executed when this migration is applied
3
4DROP TABLE orderToAuthz2;
5CREATE TABLE `orderToAuthz2` (
6 `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
7 `orderID` bigint(20) UNSIGNED NOT NULL,
8 `authzID` bigint(20) UNSIGNED NOT NULL,
9 PRIMARY KEY (`id`),
10 KEY `orderID_idx` (`orderID`),
11 KEY `authzID_idx` (`authzID`)
12) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4
13 PARTITION BY RANGE (`id`)
14(PARTITION p_start VALUES LESS THAN (MAXVALUE));
15
16-- +migrate Down
17-- SQL section 'Down' is executed when this migration is rolled back
18
19DROP TABLE orderToAuthz2;
20CREATE TABLE `orderToAuthz2` (
21 `orderID` bigint(20) NOT NULL,
22 `authzID` bigint(20) NOT NULL,
23 PRIMARY KEY (`orderID`,`authzID`),
24 KEY `authzID` (`authzID`)
25) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
26 PARTITION BY RANGE COLUMNS(orderID, authzID)
27(PARTITION p_start VALUES LESS THAN (MAXVALUE, MAXVALUE));
View as plain text