femto-backend/Femto.Database/Migrations/20250517195751_InitAuthn.sql
2025-05-17 23:47:32 +02:00

20 lines
433 B
SQL

-- Migration: InitAuthn
-- Created at: 17/05/2025 19:57:51
CREATE SCHEMA authn;
CREATE TABLE authn.user_identity
(
id uuid PRIMARY KEY,
username text NOT NULL UNIQUE,
password_hash bytea,
password_salt bytea
);
CREATE TABLE authn.user_session
(
id varchar(256) PRIMARY KEY,
user_id uuid NOT NULL REFERENCES authn.user_identity (id) ON DELETE CASCADE,
expires timestamptz NOT NULL
);