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 /verify | |
parent | 1c6642ef3ea7c6e4f4e1a90b07e1b60be6a7429b (diff) |
Add foreign key constraint to transactions referencing types.
Diffstat (limited to 'verify')
-rw-r--r-- | verify/transactions_type_code_fkey.sql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/verify/transactions_type_code_fkey.sql b/verify/transactions_type_code_fkey.sql new file mode 100644 index 0000000..bb2841c --- /dev/null +++ b/verify/transactions_type_code_fkey.sql @@ -0,0 +1,16 @@ +-- Verify kakeibo:transactions_type_code_fkey on pg + +BEGIN; + +DO $$ + BEGIN + ASSERT (SELECT 1 + FROM information_schema.table_constraints + WHERE table_schema = 'kakeibo' + AND table_name = 'transactions' + AND constraint_type = 'FOREIGN KEY' + AND constraint_name = 'transactions_type_code_fkey'); + END +$$; + +ROLLBACK; |