route96/migrations/20250202135844_payments.sql
2025-02-04 15:59:47 +00:00

22 lines
696 B
SQL

-- Add migration script here
alter table users
add column paid_until timestamp,
add column paid_space integer unsigned not null;
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,
is_paid bit(1) not null default 0,
days_value integer unsigned not null,
size_value integer unsigned not null,
settle_index integer unsigned,
rate float,
constraint fk_payments_user_id
foreign key (user_id) references users (id)
on delete cascade
on update restrict
);