
CREATE TABLE `schema_migrations` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`mysql_table` varchar(128) NOT NULL,
`migration_statement` text NOT NULL,
PRIMARY KEY (`id`)
);
Incentive: diff, and much beyond
CREATE TABLE `schema_migrations` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`mysql_table` varchar(128) NOT NULL,
`migration_statement` text NOT NULL,
`completed_timestamp` timestamp(6) NULL DEFAULT NULL,
`migration_status` varchar(128) NOT NULL,
PRIMARY KEY (`id`),
KEY `completed_status_idx` (
`completed_timestamp`,`migration_status`)
);
ALTER TABLE `schema_migrations`
MODIFY COLUMN `id` bigint unsigned NOT NULL AUTO_INCREMENT,
ADD COLUMN `completed_timestamp` timestamp(6) NULL,
ADD COLUMN `migration_status` varchar(128) NOT NULL,
ADD KEY `completed_status_idx` (`completed_timestamp`, `migration_status`);
评论