Files
buzz-sheet/drizzle/0075_fancy_ravenous.sql
gunshiz 5812d99715
CI / Verify (push) Successful in 2m30s
CI / Build immutable images and deploy (push) Successful in 3m9s
feat : comment feature
2026-10-08 01:40:08 +07:00

18 lines
2.4 KiB
SQL

-- Rename tables and their generated constraints in place, preserving data and indexes.
ALTER TABLE "comments"."comment_attachment" RENAME TO "attachment";--> statement-breakpoint
ALTER TABLE "comments"."comment_reaction" RENAME TO "reaction";--> statement-breakpoint
ALTER TABLE "comments"."comment_revision_attachment" RENAME TO "revision_attachment";--> statement-breakpoint
ALTER TABLE "comments"."comment_revision" RENAME TO "revision";--> statement-breakpoint
ALTER TABLE "comments"."comment_thread" RENAME TO "thread";--> statement-breakpoint
ALTER TABLE "comments"."attachment" RENAME CONSTRAINT "comment_attachment_comment_id_comment_id_fk" TO "attachment_comment_id_comment_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."reaction" RENAME CONSTRAINT "comment_reaction_comment_id_comment_id_fk" TO "reaction_comment_id_comment_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."reaction" RENAME CONSTRAINT "comment_reaction_user_id_user_id_fk" TO "reaction_user_id_user_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."revision_attachment" RENAME CONSTRAINT "comment_revision_attachment_revision_id_comment_revision_id_fk" TO "revision_attachment_revision_id_revision_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."revision_attachment" RENAME CONSTRAINT "comment_revision_attachment_attachment_id_comment_attachment_id_fk" TO "revision_attachment_attachment_id_attachment_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."revision" RENAME CONSTRAINT "comment_revision_comment_id_comment_id_fk" TO "revision_comment_id_comment_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."thread" RENAME CONSTRAINT "comment_thread_guide_id_guide_id_fk" TO "thread_guide_id_guide_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."thread" RENAME CONSTRAINT "comment_thread_schedule_id_stygian_schedule_schedule_id_fk" TO "thread_schedule_id_stygian_schedule_schedule_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."comment" RENAME CONSTRAINT "comment_thread_id_comment_thread_id_fk" TO "comment_thread_id_thread_id_fk";--> statement-breakpoint
ALTER TABLE "comments"."reaction" RENAME CONSTRAINT "comment_reaction_comment_id_user_id_pk" TO "reaction_comment_id_user_id_pk";--> statement-breakpoint
ALTER TABLE "comments"."revision_attachment" RENAME CONSTRAINT "comment_revision_attachment_revision_id_attachment_id_pk" TO "revision_attachment_revision_id_attachment_id_pk";