From 830e7f51b597cc29750ac017beda663f6b31bfbe Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 5 Mar 2023 14:00:25 +0900 Subject: Add foreign key constraint to transactions referencing types. --- verify/transactions_type_code_fkey.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 verify/transactions_type_code_fkey.sql (limited to 'verify') 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; -- cgit v1.2.3