Changes between Version 16 and Version 17 of WikiStart/DB


Ignore:
Timestamp:
08/24/25 21:44:49 (20 hours ago)
Author:
203206
Comment:

db3

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart/DB

    v16 v17  
    7676
    7777        if new.type = 'Deposit' then
    78                 insert into Deposit(account_id,amount, timestamp)
    79                 values (new.account_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);
    8080       
    8181        elsif new.type = 'Withdrawal' then
    82                 insert into Withdraw(account_id,amount, timestamp)
    83                 values (new.account_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);
    8484       
    8585        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.account_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),
    8888                        new.id, 'MKD';
    8989
    9090        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.account_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),
    9393                        new.id, 'USD';
    9494       
    9595        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.account_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),
    9898                        new.id, 'EUR';
    9999                       
    100100        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.account_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),
    103103                        new.id, 'GBP';
    104104
     
    123123     
    124124        INSERT INTO transfer(s_id, r_id)
    125         VALUES (NEW.account_id, NEW.account_id);
     125        VALUES (NEW.a_id, NEW.a_id);
    126126
    127127    ELSIF NEW.type = 'Withdrawal' THEN
    128128     
    129129        INSERT INTO transfer(s_id, r_id)
    130         VALUES (NEW.account_id, NEW.account_id);
     130        VALUES (NEW.a_id, NEW.a_id);
    131131
    132132    ELSIF NEW.type LIKE '(MKD) Transfer Out to%' OR
     
    137137   
    138138        INSERT INTO transfer(s_id, r_id)
    139         SELECT NEW.account_id,
     139        SELECT NEW.a_id,
    140140               (SELECT id FROM account
    141141                WHERE username = TRIM(SUBSTRING(NEW.type FROM POSITION('Transfer Out to ' IN NEW.type) + 15))