mirror of
https://github.com/openziti/zrok.git
synced 2024-12-23 07:09:12 +01:00
service; prettier for sqlite (#103)
This commit is contained in:
parent
775ebb892f
commit
cbb9ec833f
@ -1,25 +1,31 @@
|
||||
-- +migrate Up
|
||||
|
||||
alter table services add column share_mode string default 'public';
|
||||
alter table services add column backend_mode string default 'proxy';
|
||||
alter table services add column frontend_selection string;
|
||||
alter table services add column share_mode string not null default 'public';
|
||||
alter table services add column backend_mode string not null default 'proxy';
|
||||
|
||||
alter table services rename to services_old;
|
||||
|
||||
create table services (
|
||||
id integer primary key,
|
||||
environment_id integer constraint fk_environments_services references environments on delete cascade,
|
||||
z_id string not null unique,
|
||||
name string not null unique,
|
||||
frontend string,
|
||||
backend string,
|
||||
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')),
|
||||
share_mode string not null,
|
||||
backend_mode string not null
|
||||
id integer primary key,
|
||||
environment_id integer constraint fk_environments_services references environments on delete cascade,
|
||||
z_id string not null unique,
|
||||
name string not null unique,
|
||||
share_mode string not null,
|
||||
backend_mode string not null,
|
||||
frontend_selection string,
|
||||
frontend_endpoint string,
|
||||
backend_proxy_endpoint string,
|
||||
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 <> ''),
|
||||
constraint chk_name check (name <> ''),
|
||||
constraint chk_share_mode check (share_mode == 'public' || share_mode == 'private'),
|
||||
constraint chk_backend_mode check (backend_mode == 'proxy' || backend_mode == 'web' || backend_mode == 'dav')
|
||||
);
|
||||
insert into services select * from services_old;
|
||||
|
||||
insert into services (id, environment_id, z_id, name, share_mode, backend_mode, frontend_selection, frontend_endpoint, backend_proxy_endpoint, created_at, updated_at)
|
||||
select id, environment_id, z_id, name, share_mode, backend_mode, frontend_selection, frontend, backend, created_at, updated_at from services_old;
|
||||
|
||||
drop table services_old;
|
||||
|
Loading…
Reference in New Issue
Block a user