mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
10 lines
461 B
MySQL
10 lines
461 B
MySQL
|
|
ALTER TABLE "Notes" DROP CONSTRAINT "Notes_replyId_Notes_id_fk";
|
||
|
|
--> statement-breakpoint
|
||
|
|
DROP INDEX IF EXISTS "Notes_uri_index";--> statement-breakpoint
|
||
|
|
DO $$ BEGIN
|
||
|
|
ALTER TABLE "Notes" ADD CONSTRAINT "Notes_replyId_Notes_id_fk" FOREIGN KEY ("replyId") REFERENCES "Notes"("id") ON DELETE cascade ON UPDATE cascade;
|
||
|
|
EXCEPTION
|
||
|
|
WHEN duplicate_object THEN null;
|
||
|
|
END $$;
|
||
|
|
--> statement-breakpoint
|
||
|
|
ALTER TABLE "Notes" ADD CONSTRAINT "Notes_uri_unique" UNIQUE("uri");
|