blog/backend/migrations/20250801062251_create_post_label_table.sql
SquidSpirit ded3d6c363
All checks were successful
Frontend CI / build (push) Successful in 1m9s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 17s
PR Title Check / pr-title-check (pull_request) Successful in 16s
BLOG-95 refactor: seperate sql migration files
2025-08-01 14:51:05 +08:00

8 lines
296 B
SQL

CREATE TABLE IF NOT EXISTS "post_label" (
"post_id" INTEGER NOT NULL,
"label_id" INTEGER NOT NULL,
PRIMARY KEY ("post_id", "label_id"),
FOREIGN KEY ("post_id") REFERENCES "post" ("id") ON DELETE CASCADE,
FOREIGN KEY ("label_id") REFERENCES "label" ("id") ON DELETE CASCADE
);