-
Notifications
You must be signed in to change notification settings - Fork 13
/
schema.sql
35 lines (27 loc) · 1.05 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CREATE TABLE dep_names (
name VARCHAR(255) NOT NULL,
-- OAuth1 Tokens
consumer_key TEXT NULL,
consumer_secret TEXT NULL,
access_token TEXT NULL,
access_secret TEXT NULL,
access_token_expiry TIMESTAMP NULL,
-- Config
config_base_url VARCHAR(255) NULL,
-- Token PKI
tokenpki_cert_pem TEXT NULL,
tokenpki_key_pem TEXT NULL,
tokenpki_staging_cert_pem TEXT NULL,
tokenpki_staging_key_pem TEXT NULL,
-- Syncer
-- From Apple docs: "The string can be up to 1000 characters".
syncer_cursor VARCHAR(1024) NULL,
-- Assigner
assigner_profile_uuid TEXT NULL,
assigner_profile_uuid_at TIMESTAMP NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (name),
CHECK (tokenpki_cert_pem IS NULL OR SUBSTRING(tokenpki_cert_pem FROM 1 FOR 27) = '-----BEGIN CERTIFICATE-----'),
CHECK (tokenpki_key_pem IS NULL OR SUBSTRING(tokenpki_key_pem FROM 1 FOR 5) = '-----')
);