Files
mtusi2026lab2/service/migrations/003_create_auth_identities_table.sql
T

17 lines
627 B
SQL

CREATE TABLE IF NOT EXISTS auth_identities
(
id UUID PRIMARY KEY,
role VARCHAR(12) NOT NULL,
user_id UUID NOT NULL,
provider TEXT NOT NULL,
identifier TEXT NOT NULL,
password_hash TEXT,
status VARCHAR(24) NOT NULL DEFAULT 'PENDING',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
CONSTRAINT fk_auth_identities_users FOREIGN KEY (user_id) REFERENCES users (id),
UNIQUE (provider, identifier)
);
---- create above / drop below ----
DROP TABLE IF EXISTS auth_identities;