update schemas to support 'tunnel' backend mode (#170)

This commit is contained in:
Michael Quigley 2023-04-17 11:53:18 -04:00
parent fd741353d7
commit ab6df21273
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,3 @@
-- +migrate Up
alter type backend_mode rename value 'dav' to 'tunnel';

View File

@ -0,0 +1,26 @@
-- +migrate Up
alter table shares rename to shares_old;
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')), deleted boolean not null default(false),
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 == 'tunnel')
);
insert into shares select * from shares_old;
drop table shares_old;