1
2DROP SCHEMA IF EXISTS auth_schema CASCADE;
3
4CREATE SCHEMA IF NOT EXISTS auth_schema;
5
6CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
7
8CREATE TABLE IF NOT EXISTS auth_schema.users (
9 username TEXT NOT NULL,
10 nonce TEXT NOT NULL,
11 timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
12 nonce_count integer NOT NULL DEFAULT 0,
13 ha1 TEXT NOT NULL,
14 PRIMARY KEY(username)
15);
16
17CREATE TABLE IF NOT EXISTS auth_schema.unnamed_nonce (
18 id uuid NOT NULL,
19 nonce TEXT NOT NULL,
20 creation_time TIMESTAMPTZ NOT NULL,
21 PRIMARY KEY(id),
22 UNIQUE(nonce)
23);
24