userver: samples/digest_auth_service/postgresql/schemas/auth.sql
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
samples/digest_auth_service/postgresql/schemas/auth.sql
1/* /// [postgresql schema] */
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/* /// [postgresql schema] */