Files
tcg-collectors-server/src/migrations/008_add-fk-relationship-items-with-set-id.js
T
joseph.nelson4456 96b06cf92d added item route details (#6)
Reviewed-on: #6
Co-authored-by: Joseph Nelson <joseph.nelson4456@gmail.com>
Co-committed-by: Joseph Nelson <joseph.nelson4456@gmail.com>
2026-05-16 23:42:41 -07:00

17 lines
288 B
JavaScript

export const up = (pgm) => {
pgm.sql(`
ALTER TABLE "items"
ADD CONSTRAINT "set_id"
FOREIGN KEY ("set_id")
REFERENCES "sets" ("id")
ON DELETE CASCADE;
`)
}
export const down = (pgm) => {
pgm.sql(`
ALTER TABLE "items"
DROP CONSTRAINT "fk_name";
`)
}