Changes between Version 16 and Version 17 of WikiStart/DB
- Timestamp:
- 08/24/25 21:44:49 (20 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart/DB
v16 v17 76 76 77 77 if new.type = 'Deposit' then 78 insert into Deposit(a ccount_id,amount,timestamp)79 values (new.a ccount_id, new.amount, new.timestamp);78 insert into Deposit(a_id, amount, deposit_timestamp) 79 values (new.a_id, new.deposit_amount, new.deposit_timestamp); 80 80 81 81 elsif new.type = 'Withdrawal' then 82 insert into Withdraw(a ccount_id,amount,timestamp)83 values (new.a ccount_id, new.amount, new.timestamp);82 insert into Withdraw(a_id, amount, withdraw_timestamp) 83 values (new.a_id, new.withdraw_amount, new.withdraw_timestamp); 84 84 85 85 elsif new.type like '(MKD) Transfer Out to%' then 86 insert into transferred_money(s_ account_id, r_account_id, t_id, currency)87 select new.a ccount_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1),86 insert into transferred_money(s_id, r_id, t_id, currency) 87 select new.a_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1), 88 88 new.id, 'MKD'; 89 89 90 90 elsif new.type like '(USD) Transfer Out to%' then 91 insert into transferred_money(s_ account_id, r_account_id, t_id, currency)92 select new.a ccount_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1),91 insert into transferred_money(s_id, r_id, t_id, currency) 92 select new.a_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1), 93 93 new.id, 'USD'; 94 94 95 95 elsif new.type like '(EUR) Transfer Out to%' then 96 insert into transferred_money(s_ account_id, r_account_id, t_id, currency)97 select new.a ccount_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1),96 insert into transferred_money(s_id, r_id, t_id, currency) 97 select new.a_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1), 98 98 new.id, 'EUR'; 99 99 100 100 elsif new.type like '(GBP) Transfer Out to%' then 101 insert into transferred_money(s_ account_id, r_account_id, t_id, currency)102 select new.a ccount_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1),101 insert into transferred_money(s_id, r_id, t_id, currency) 102 select new.a_id, (select id from account where username = trim(substring(new.type from position('Transfer Out to ' in new.type)+15)) limit 1), 103 103 new.id, 'GBP'; 104 104 … … 123 123 124 124 INSERT INTO transfer(s_id, r_id) 125 VALUES (NEW.a ccount_id, NEW.account_id);125 VALUES (NEW.a_id, NEW.a_id); 126 126 127 127 ELSIF NEW.type = 'Withdrawal' THEN 128 128 129 129 INSERT INTO transfer(s_id, r_id) 130 VALUES (NEW.a ccount_id, NEW.account_id);130 VALUES (NEW.a_id, NEW.a_id); 131 131 132 132 ELSIF NEW.type LIKE '(MKD) Transfer Out to%' OR … … 137 137 138 138 INSERT INTO transfer(s_id, r_id) 139 SELECT NEW.a ccount_id,139 SELECT NEW.a_id, 140 140 (SELECT id FROM account 141 141 WHERE username = TRIM(SUBSTRING(NEW.type FROM POSITION('Transfer Out to ' IN NEW.type) + 15))