lemmy/migrations/2019-02-26-002946_create_user/up.sql

24 lines
675 B
MySQL
Raw Normal View History

create table user_ (
id serial primary key,
name varchar(20) not null,
fedi_name varchar(40) not null,
2019-03-04 11:39:07 -05:00
preferred_username varchar(20),
password_encrypted text not null,
email text unique,
icon bytea,
2019-04-16 19:04:23 -04:00
admin boolean default false not null,
banned boolean default false not null,
published timestamp not null default now(),
updated timestamp,
unique(name, fedi_name)
);
create table user_ban (
id serial primary key,
user_id int references user_ on update cascade on delete cascade not null,
published timestamp not null default now(),
unique (user_id)
);
insert into user_ (name, fedi_name, password_encrypted) values ('admin', 'TBD', 'TBD');