route96/migrations/20250202135844_payments.sql

22 lines
695 B
MySQL
Raw Normal View History

2025-02-04 13:06:26 +00:00
-- Add migration script here
alter table users
add column paid_until timestamp,
2025-02-05 16:28:37 +00:00
add column paid_size integer unsigned not null;
2025-02-04 13:06:26 +00:00
create table payments
(
payment_hash binary(32) not null primary key,
user_id integer unsigned not null,
created timestamp default current_timestamp,
amount integer unsigned not null,
2025-02-04 15:59:47 +00:00
is_paid bit(1) not null default 0,
2025-02-04 13:06:26 +00:00
days_value integer unsigned not null,
size_value integer unsigned not null,
2025-02-04 15:59:47 +00:00
settle_index integer unsigned,
rate float,
2025-02-04 13:06:26 +00:00
2025-02-04 15:59:47 +00:00
constraint fk_payments_user_id
2025-02-04 13:06:26 +00:00
foreign key (user_id) references users (id)
on delete cascade
on update restrict
);