From cf77948ac57758982ca7defb9824864f261fd403 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Tue, 15 Nov 2022 11:04:05 -0500 Subject: [PATCH] availability_type; frontends; environments.account_id nullale; (#20) --- .../store/sql/postgresql/002_ingress_selection.sql | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/controller/store/sql/postgresql/002_ingress_selection.sql b/controller/store/sql/postgresql/002_ingress_selection.sql index e69b9a30..7d3a9e90 100644 --- a/controller/store/sql/postgresql/002_ingress_selection.sql +++ b/controller/store/sql/postgresql/002_ingress_selection.sql @@ -1,9 +1,16 @@ -- +migrate Up -create table ingress ( +create type availability_type as enum ('public', 'private'); + +create table frontends ( id serial primary key, - account_id integer references accounts(id), + environment_id integer references environments(id), z_id varchar(32) not null unique, + type availability_type not null, created_at timestamptz not null default(current_timestamp), updated_at timestamptz not null default(current_timestamp) -); \ No newline at end of file +); + +-- environments.account_id should allow NULL; environments with NULL account_id are "ephemeral" +alter table environments drop constraint fk_accounts_identities; +alter table environments add constraint fk_accounts_id foreign key (account_id) references accounts(id); \ No newline at end of file