Saving token to DB

This commit is contained in:
2024-08-13 22:00:07 +02:00
parent 6b7ce5b719
commit e7f6983a22
4 changed files with 57 additions and 3 deletions

View File

@ -0,0 +1,2 @@
drop_table("tokens")

View File

@ -0,0 +1,11 @@
create_table("tokens") {
t.Column("id", "integer", {primary: true})
t.Column("user_id", "integer", {"unsigned": true})
t.Column("name", "string", {"size": 255})
t.Column("email", "string", {})
t.Column("token_hash", "string", {})
}
sql("ALTER TABLE tokens MODIFY token_hash varbinary(255);")
sql("ALTER TABLE tokens ALTER COLUMN created_at SET DEFAULT now();")
sql("ALTER TABLE tokens ALTER COLUMN updated_at SET DEFAULT now();")