udemy-go-web-2/migrations/20240813194454_create_tokens_table.up.fizz
2024-08-13 22:00:07 +02:00

12 lines
451 B
Plaintext

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();")