diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-05 14:00:25 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-05 14:00:25 +0900 |
commit | 830e7f51b597cc29750ac017beda663f6b31bfbe (patch) | |
tree | f74ec81d384db9c0d10ed306625d965f420cdb0a /deploy | |
parent | 1c6642ef3ea7c6e4f4e1a90b07e1b60be6a7429b (diff) |
Add foreign key constraint to transactions referencing types.
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/transactions_type_code_fkey.sql | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/deploy/transactions_type_code_fkey.sql b/deploy/transactions_type_code_fkey.sql new file mode 100644 index 0000000..ba4406b --- /dev/null +++ b/deploy/transactions_type_code_fkey.sql @@ -0,0 +1,12 @@ +-- Deploy kakeibo:transactions_type_code_fkey to pg +-- requires: transactions +-- requires: types + +BEGIN; + +ALTER TABLE kakeibo.transactions + ADD CONSTRAINT transactions_type_code_fkey + FOREIGN KEY (type_code) + REFERENCES kakeibo.types (code); + +COMMIT; |