You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ALTER TABLE `users` CHANGE `status` `status` enum('active','inactive') DEFAULT 'active';
ALTER TABLE `posts` DROP `published_at`;
ALTER TABLE `users` DROP `phone`;
ALTER TABLE `users` DROP `updated_at`;
INSERT INTO `posts` (`id`,`user_id`,`title`,`content`,`published`) VALUES('3','2','Jane Post','This is Jane post content','1');
INSERT INTO `users` (`id`,`name`,`email`,`status`,`created_at`) VALUES('3','Bob Wilson','bob@example.com','inactive','2024-01-01 00:00:00');
UPDATE `posts` SET `title` = 'First Post', `content` = 'This is the first post content' WHERE `id` = '1';
UPDATE `posts` SET `published` = '0' WHERE `id` = '2';
UPDATE `users` SET `created_at` = '2024-01-01 00:00:00' WHERE `id` = '1';
UPDATE `users` SET `status` = 'active', `created_at` = '2024-01-01 00:00:00' WHERE `id` = '2';
#---------- DOWN ----------
DELETE FROM `posts` WHERE `id` = '3';
DELETE FROM `users` WHERE `id` = '3';
ALTER TABLE `users` CHANGE `status` `status` enum('active','inactive','pending') DEFAULT 'pending';
ALTER TABLE `posts` ADD `published_at` datetime DEFAULT NULL;
ALTER TABLE `users` ADD `phone` varchar(20) DEFAULT NULL;
ALTER TABLE `users` ADD `updated_at` timestamp NULL DEFAULT '2024-01-01 00:00:00';
ALTER TABLE `posts` ADD KEY `published` (`published`);
ALTER TABLE `users` ADD KEY `status` (`status`);
INSERT INTO `posts` (`id`,`user_id`,`title`,`content`,`published`,`published_at`) VALUES('4','4','Alice Post','This is Alice post content','1','2024-01-03 12:00:00');
INSERT INTO `users` (`id`,`name`,`email`,`phone`,`status`,`created_at`,`updated_at`) VALUES('4','Alice Brown','alice@example.com','555-9999','active','2024-01-01 00:00:10','2024-01-01 00:00:10');
UPDATE `posts` SET `title` = 'First Post Updated', `content` = 'This is the updated first post content' WHERE `id` = '1';
UPDATE `posts` SET `published` = '1' WHERE `id` = '2';
UPDATE `users` SET `created_at` = '2024-01-01 00:00:10' WHERE `id` = '1';
UPDATE `users` SET `status` = 'pending', `created_at` = '2024-01-01 00:00:10' WHERE `id` = '2';