feat: add diesel setup to project
This commit is contained in:
parent
faeebf8376
commit
18a321853a
14 changed files with 203 additions and 1 deletions
2
migrations/2025-01-13-115534_add_auth/down.sql
Normal file
2
migrations/2025-01-13-115534_add_auth/down.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
drop table sessions;
|
||||
drop table users;
|
||||
14
migrations/2025-01-13-115534_add_auth/up.sql
Normal file
14
migrations/2025-01-13-115534_add_auth/up.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
create table users (
|
||||
id integer primary key not null,
|
||||
username text unique not null,
|
||||
password_hash text not null,
|
||||
admin boolean not null
|
||||
);
|
||||
|
||||
create table sessions (
|
||||
id integer primary key not null,
|
||||
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