phonograph/migrations/20250522224809_bases.up.sql

20 lines
619 B
MySQL
Raw Normal View History

2025-05-26 22:08:21 -07:00
create table if not exists bases (
id uuid not null primary key,
name text not null default '',
url text not null,
owner_id uuid not null references users(id)
on delete restrict,
user_role_prefix text not null default '__itmu__'
);
create index on bases (owner_id);
create table if not exists base_user_perms (
id uuid not null primary key,
base_id uuid not null references bases(id),
user_id uuid not null references users(id),
perm text not null,
unique (base_id, user_id, perm)
);
create index on base_user_perms (user_id);
create index on base_user_perms (base_id);