aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2023-03-05 12:57:14 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2023-03-05 12:57:14 +0900
commit1c6642ef3ea7c6e4f4e1a90b07e1b60be6a7429b (patch)
tree4a7203f092a8658b9a0bd0b643f4441201111df8
parent4b552c58f5988d1af18ef34ccec5979081c3bc14 (diff)
Rename column of transactions from type to type_code.
-rw-r--r--deploy/transactions_type_code.sql8
-rw-r--r--revert/transactions_type_code.sql7
-rw-r--r--sqitch.plan1
-rw-r--r--verify/transactions_type_code.sql14
4 files changed, 30 insertions, 0 deletions
diff --git a/deploy/transactions_type_code.sql b/deploy/transactions_type_code.sql
new file mode 100644
index 0000000..5c29ec9
--- /dev/null
+++ b/deploy/transactions_type_code.sql
@@ -0,0 +1,8 @@
+-- Deploy kakeibo:transactions_type_code to pg
+-- requires: transactions
+
+BEGIN;
+
+ALTER TABLE kakeibo.transactions RENAME COLUMN type to type_code;
+
+COMMIT;
diff --git a/revert/transactions_type_code.sql b/revert/transactions_type_code.sql
new file mode 100644
index 0000000..9e97209
--- /dev/null
+++ b/revert/transactions_type_code.sql
@@ -0,0 +1,7 @@
+-- Revert kakeibo:transactions_type_code from pg
+
+BEGIN;
+
+ALTER TABLE kakeibo.transactions RENAME COLUMN type_code to type;
+
+COMMIT;
diff --git a/sqitch.plan b/sqitch.plan
index 5bb51d2..6780aca 100644
--- a/sqitch.plan
+++ b/sqitch.plan
@@ -21,3 +21,4 @@ transaction_type [transaction_type@v1.0.0-dev1 appschema] 2023-03-04T11:13:26Z M
@v1.0.0-dev2 2023-03-04T11:24:20Z Masaya Tojo <masaya@tojo.tokyo> # Tag v1.0.0-dev2.
types [appschema] 2023-03-05T03:45:31Z Masaya Tojo <masaya@tojo.tokyo> # Add types table for manage type column of transactions.
+transactions_type_code [transactions] 2023-03-05T03:53:38Z Masaya Tojo <masaya@tojo.tokyo> # Rename column of transactions from type to type_code.
diff --git a/verify/transactions_type_code.sql b/verify/transactions_type_code.sql
new file mode 100644
index 0000000..d374d71
--- /dev/null
+++ b/verify/transactions_type_code.sql
@@ -0,0 +1,14 @@
+-- Verify kakeibo:transactions_type_code on pg
+
+BEGIN;
+
+SELECT id,
+ type_code,
+ date,
+ note,
+ created_at,
+ updated_at
+ FROM kakeibo.transactions
+ WHERE FALSE;
+
+ROLLBACK;