mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 19:20:39 +09:00
9 lines
367 B
MySQL
9 lines
367 B
MySQL
|
|
ALTER TABLE "document_revisions" ADD COLUMN "title" text;--> statement-breakpoint
|
||
|
|
ALTER TABLE "document_revisions" ADD COLUMN "format" text DEFAULT 'markdown' NOT NULL;--> statement-breakpoint
|
||
|
|
UPDATE "document_revisions" AS "dr"
|
||
|
|
SET
|
||
|
|
"title" = "d"."title",
|
||
|
|
"format" = COALESCE("d"."format", 'markdown')
|
||
|
|
FROM "documents" AS "d"
|
||
|
|
WHERE "d"."id" = "dr"."document_id";
|