Skip to content

Commit

Permalink
delete mock transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKomarovCoder committed Dec 25, 2023
1 parent 2716741 commit 857359f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions build/schema/initdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ CREATE OR REPLACE FUNCTION add_default_categories_accounts_transactions()
RETURNS TRIGGER AS $$
DECLARE
categoryID UUID;
transaction_idI UUID;
transaction_idO UUID;
-- transaction_idI UUID;
-- transaction_idO UUID;
accountCashID UUID;
accountCardID UUID;
BEGIN
Expand Down Expand Up @@ -121,17 +121,17 @@ BEGIN
INSERT INTO userAccount(user_id, account_id)
VALUES (NEW.id, accountCashID);

INSERT INTO transaction(user_id, account_income, account_outcome, income, outcome, payer, description)
VALUES (NEW.id, accountCardID,
accountCardID, 0, 100, 'Тестовая транзакция1', 'Все хомячки приветствуют вас, и просят удалить эти транзации)') RETURNING id INTO transaction_idI;
-- INSERT INTO transaction(user_id, account_income, account_outcome, income, outcome, payer, description)
-- VALUES (NEW.id, accountCardID,
-- accountCardID, 0, 100, 'Тестовая транзакция1', 'Все хомячки приветствуют вас, и просят удалить эти транзации)') RETURNING id INTO transaction_idI;

INSERT INTO transaction(user_id, account_income, account_outcome, income, outcome, payer, description)
VALUES (NEW.id, accountCardID,
accountCardID, 100, 0, 'Тестовая транзакция2', 'Все хомячки приветствуют вас, и просят удалить эти транзации)') RETURNING id INTO transaction_idO;
-- INSERT INTO transaction(user_id, account_income, account_outcome, income, outcome, payer, description)
-- VALUES (NEW.id, accountCardID,
-- accountCardID, 100, 0, 'Тестовая транзакция2', 'Все хомячки приветствуют вас, и просят удалить эти транзации)') RETURNING id INTO transaction_idO;

INSERT INTO TransactionCategory(transaction_id, category_id)
VALUES (transaction_idI, categoryID),
(transaction_idO, categoryID);
-- INSERT INTO TransactionCategory(transaction_id, category_id)
-- VALUES (transaction_idI, categoryID),
-- (transaction_idO, categoryID);

RETURN NEW;
END;
Expand Down

0 comments on commit 857359f

Please sign in to comment.