From 248017b5b50f4e00c909abc234ed71b4dced9f37 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Mon, 13 Mar 2023 00:49:16 +0900
Subject: Add foreign key constraint to transactions table referencing types
 table.

---
 deploy/transactions@v1.0.0-alpha.2.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 deploy/transactions@v1.0.0-alpha.2.sql

(limited to 'deploy/transactions@v1.0.0-alpha.2.sql')

diff --git a/deploy/transactions@v1.0.0-alpha.2.sql b/deploy/transactions@v1.0.0-alpha.2.sql
new file mode 100644
index 0000000..0572a23
--- /dev/null
+++ b/deploy/transactions@v1.0.0-alpha.2.sql
@@ -0,0 +1,12 @@
+-- Deploy kakeibo:transactions to pg
+-- requires: schema
+-- requires: articles
+
+BEGIN;
+
+ALTER TABLE kakeibo.transactions
+  ADD COLUMN article_id INTEGER,
+  ADD CONSTRAINT transactions_article_id_fkey
+  FOREIGN KEY (article_id) REFERENCES kakeibo.articles (id);
+
+COMMIT;
-- 
cgit v1.2.3

