fine, sqlite, fine... (#96)

This commit is contained in:
Michael Quigley 2023-01-13 13:29:34 -05:00
parent 4e4bd1c876
commit e8e87ca6ac
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -1,22 +1,3 @@
-- +migrate Up
alter table accounts rename to accounts_old;
create table accounts (
id integer primary key,
email string not null unique,
password string not null,
token string not null unique,
limitless boolean not null default(false),
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
constraint chk_email check (email <> ''),
constraint chk_password check (password <> ''),
constraint chk_token check(token <> '')
);
insert into accounts (id, email, password, token, created_at, updated_at)
select id, email, password, token, created_at, updated_at from accounts_old;
drop table accounts_old;
alter table accounts add column limitless boolean not null default(false);