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" ALTER COLUMN "status" SET DEFAULT 'active'::character varying;
ALTER TABLE "posts" DROP COLUMN "published_at" CASCADE;
ALTER TABLE "users" DROP COLUMN "phone" CASCADE;
ALTER TABLE "users" DROP COLUMN "updated_at" CASCADE;
INSERT INTO "posts" ("id","user_id","title","content","published") VALUES('3','2','Jane Post','This is Jane post content',true);
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" = false 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" ALTER COLUMN "status" SET DEFAULT 'pending'::character varying;
ALTER TABLE "posts" ADD COLUMN "published_at" timestamp;
ALTER TABLE "users" ADD COLUMN "phone" varchar(20) DEFAULT NULL::character varying;
ALTER TABLE "users" ADD COLUMN "updated_at" timestamp DEFAULT '2024-01-01 00:00:00'::timestamp without time zone;
CREATE INDEX posts_published_idx ON public.posts USING btree (published);
CREATE INDEX users_status_idx ON public.users USING btree (status);
INSERT INTO "posts" ("id","user_id","title","content","published","published_at") VALUES('4','4','Alice Post','This is Alice post content',true,'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" = true 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';