feat: add user and session entities
This commit is contained in:
parent
f51b6ce3b3
commit
a65b647f65
3 changed files with 60 additions and 0 deletions
14
src/migrations/004_auth.sql
Normal file
14
src/migrations/004_auth.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
create table users (
|
||||
id integer primary key,
|
||||
username text unique not null,
|
||||
password_hash text not null,
|
||||
admin boolean not null
|
||||
);
|
||||
|
||||
create table sessions (
|
||||
id integer primary key,
|
||||
user_id integer not null
|
||||
references users (id)
|
||||
on delete cascade,
|
||||
unique (id, user_id)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue