mirror of
https://github.com/openziti/zrok.git
synced 2024-11-26 10:04:16 +01:00
parent
24f2e48e48
commit
dcdc00dcf4
@ -0,0 +1,27 @@
|
|||||||
|
-- +migrate Up
|
||||||
|
|
||||||
|
create table frontends (
|
||||||
|
id serial primary key,
|
||||||
|
environment_id integer references environments(id),
|
||||||
|
z_id varchar(32) not null unique,
|
||||||
|
name varchar(64) 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'))
|
||||||
|
);
|
||||||
|
|
||||||
|
-- environments.account_id should allow NULL; environments with NULL account_id are "ephemeral"
|
||||||
|
alter table environments rename to environments_old;
|
||||||
|
create table environments (
|
||||||
|
id integer primary key,
|
||||||
|
account_id integer references accounts(id) on delete cascade,
|
||||||
|
description string,
|
||||||
|
host string,
|
||||||
|
address string,
|
||||||
|
z_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_z_id check (z_id <> '')
|
||||||
|
);
|
||||||
|
insert into environments select * from environments_old;
|
||||||
|
drop table environments_old;
|
Loading…
Reference in New Issue
Block a user