mirror of
https://github.com/openziti/zrok.git
synced 2025-02-22 05:01:01 +01:00
services -> shares in the schema (#144)
This commit is contained in:
parent
db10a8882f
commit
1e6c35d6de
@ -0,0 +1,8 @@
|
||||
-- +migrate Up
|
||||
|
||||
alter table services rename to shares;
|
||||
alter sequence services_id_seq1 rename to shares_id_seq1;
|
||||
alter index services_pkey1 rename to shares_pkey1;
|
||||
alter index services_token_key rename to shares_token_key;
|
||||
alter index services_z_id_key1 rename to shares_z_id_key1;
|
||||
alter table shares rename constraint services_environment_id_fkey to shares_environment_id_fkey;
|
@ -0,0 +1,25 @@
|
||||
-- +migrate Up
|
||||
|
||||
create table shares (
|
||||
id integer primary key,
|
||||
environment_id integer constraint fk_environments_shares references environments on delete cascade,
|
||||
z_id string not null unique,
|
||||
token string not null unique,
|
||||
share_mode string not null,
|
||||
backend_mode string not null,
|
||||
frontend_selection string,
|
||||
frontend_endpoint string,
|
||||
backend_proxy_endpoint string,
|
||||
reserved boolean not null default(false),
|
||||
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_token check (token <> ''),
|
||||
constraint chk_share_mode check (share_mode == 'public' or share_mode == 'private'),
|
||||
constraint chk_backend_mode check (backend_mode == 'proxy' or backend_mode == 'web' or backend_mode == 'dav')
|
||||
);
|
||||
|
||||
insert into shares select * from services;
|
||||
|
||||
drop table services;
|
Loading…
Reference in New Issue
Block a user