basic store migrations to support access_grants (#432)

This commit is contained in:
Michael Quigley 2024-02-29 13:24:31 -05:00
parent 00a5622778
commit 5cfd67ab19
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,14 @@
-- +migrate Up
create type permission_mode_type as enum('open', 'closed');
alter table shares add column permission_mode permission_mode_type not null default('open');
create table access_grants (
id serial primary key,
share_id integer references shares(id),
account_id integer references accounts(id),
created_at timestamptz not null default(current_timestamp),
updated_at timestamptz not null default(current_timestamp),
deleted boolean not null default(false)
);

View File

@ -0,0 +1,12 @@
-- +migrate Up
alter table shares add column permission_mode string not null default('open');
create table access_grants (
id serial primary key,
share_id integer references shares(id),
account_id integer references accounts(id),
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)
);