From 131c856bdd5c48bbd8358fc8c1840fce4fcf2178 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Sun, 5 Mar 2023 14:29:29 +0900
Subject: Rename column of transactions from type to type_code.

---
 deploy/insert_transaction.sql | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'deploy/insert_transaction.sql')

diff --git a/deploy/insert_transaction.sql b/deploy/insert_transaction.sql
index 42e825d..6c39e9e 100644
--- a/deploy/insert_transaction.sql
+++ b/deploy/insert_transaction.sql
@@ -4,7 +4,6 @@
 
 BEGIN;
 
-DROP FUNCTION kakeibo.insert_transaction(kakeibo.transaction_type, DATE, TEXT);
 CREATE OR REPLACE FUNCTION kakeibo.insert_transaction(
   p_type INTEGER,
   p_date DATE,
@@ -14,7 +13,7 @@ DECLARE
   inserted_id INTEGER;
 BEGIN
   INSERT INTO kakeibo.transactions (
-    type, date, note
+    type_code, date, note
   ) VALUES (
     p_type, p_date, p_note
   ) RETURNING id INTO inserted_id;
-- 
cgit v1.2.3

