MarseyWorld/migrations/20230801-move-lifetimedonat...

5 lines
359 B
MySQL
Raw Normal View History

2023-08-03 21:04:09 +00:00
drop function lifetimedonated;
2023-08-01 07:16:47 +00:00
alter table users add column lifetimedonated int not null default 0;
alter table users alter column lifetimedonated drop default;
update users set lifetimedonated=(select sum(amount) from transactions where transactions.email = users.email) where (select sum(amount) from transactions where transactions.email = users.email)>0;