mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
11 lines
428 B
MySQL
11 lines
428 B
MySQL
|
|
-- Migration 009: Add config.sessions table for auth tokens
|
||
|
|
-- Idempotent per docs/migrations.md
|
||
|
|
|
||
|
|
CREATE TABLE IF NOT EXISTS config.sessions (
|
||
|
|
token TEXT PRIMARY KEY,
|
||
|
|
operator_id BIGINT NOT NULL REFERENCES config.operators(id) ON DELETE CASCADE,
|
||
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||
|
|
expires_at TIMESTAMPTZ NOT NULL
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS sessions_expires_at_idx ON config.sessions(expires_at);
|