14 lines
458 B
MySQL
14 lines
458 B
MySQL
|
CREATE TABLE user_sessions(
|
||
|
"id" serial primary key not null,
|
||
|
"index_id" bigserial not null,
|
||
|
"username" varchar not null references "users"("username") not null,
|
||
|
"refresh_token" varchar not null,
|
||
|
"user_agent" varchar not null,
|
||
|
"client_ip" varchar not null,
|
||
|
"is_blocked" boolean not null default false,
|
||
|
"expires_at" timestamp not null,
|
||
|
"created_at" timestamp default(now())
|
||
|
);
|
||
|
|
||
|
CREATE INDEX ON "user_sessions"("index_id");
|