astral-api/Astral.DAL/Migrations/2024-12-14.01-refreshTokens.sql

11 lines
309 B
MySQL
Raw Normal View History

2024-12-14 17:31:17 +01:00
CREATE TABLE refreshTokens
(
token TEXT UNIQUE PRIMARY KEY NOT NULL,
userId UUID REFERENCES users(id) ON DELETE CASCADE,
ipAddress TEXT NOT NULL,
role SMALLINT NOT NULL,
scope SMALLINT NOT NULL,
expires TIMESTAMP NOT NULL,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
);