feat: use diesel-cli instead of hand writing tables
after reading the documentation, crazy right? I figured out i was making my life hard, this makes my life easy again
This commit is contained in:
parent
f1d5b4316e
commit
a6d35b0ba2
24 changed files with 323 additions and 206 deletions
13
migrations/2025-05-21-193321_create_tokens/up.sql
Normal file
13
migrations/2025-05-21-193321_create_tokens/up.sql
Normal file
|
@ -0,0 +1,13 @@
|
|||
-- Your SQL goes here
|
||||
CREATE TABLE refresh_tokens (
|
||||
token varchar(64) PRIMARY KEY UNIQUE NOT NULL,
|
||||
uuid uuid NOT NULL REFERENCES users(uuid),
|
||||
created_at int8 NOT NULL,
|
||||
device_name varchar(16) NOT NULL
|
||||
);
|
||||
CREATE TABLE access_tokens (
|
||||
token varchar(32) PRIMARY KEY UNIQUE NOT NULL,
|
||||
refresh_token varchar(64) UNIQUE NOT NULL REFERENCES refresh_tokens(token) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
uuid uuid NOT NULL REFERENCES users(uuid),
|
||||
created_at int8 NOT NULL
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue