identities ddl (#10)

This commit is contained in:
Michael Quigley 2022-07-29 13:33:55 -04:00
parent e63e831374
commit 7fd1287465
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -16,15 +16,28 @@ create table accounts (
constraint chk_token check(token <> '')
);
--
-- identities
--
create table identities (
id integer primary key,
account_id integer constraint fk_accounts_identities references accounts on delete cascade,
ziti_id string not null unique,
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
constraint chk_ziti_id check (ziti_id <> '')
);
--
-- services
--
create table services (
id integer primary key,
account_id integer constraint fk_accounts_service references accounts on delete cascade,
account_id integer constraint fk_accounts_services references accounts on delete cascade,
ziti_id string not null unique,
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
constraint chk_name check (ziti_id <> '')
constraint chk_ziti_id check (ziti_id <> '')
);