Skip to content

Commit 3756bb8

Browse files
authored
Merge pull request #374 from vuejs-jp/feature/master-sync
[実験機能] [備品管理向け] test - for mastersync
2 parents ccd7ea6 + 92c4ab0 commit 3756bb8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

supabase/schema.sql

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,60 @@ create policy "Allow update for all attendees." on public.attendees for
206206
update
207207
using (true);
208208

209+
create table if not exists public.masters (
210+
id uuid not null primary key default uuid_generate_v4(),
211+
name varchar(100) not null,
212+
owner_name varchar(100) not null,
213+
image_url varchar(500),
214+
memo varchar(1000),
215+
is_same_day_disposal bool not null,
216+
is_open bool not null,
217+
created_at timestamp with time zone default timezone('utc' :: text, now()) not null,
218+
updated_at timestamp with time zone default timezone('utc' :: text, now()) not null
219+
);
220+
221+
alter table
222+
public.masters enable row level security;
223+
224+
create policy "Allow select for all masters." on public.masters for
225+
select
226+
using (true);
227+
228+
create policy "Allow insert for all masters." on public.masters for
229+
insert
230+
with check (true);
231+
232+
create policy "Allow update for all masters." on public.masters for
233+
update
234+
using (true);
235+
236+
create table if not exists public.logs_status_master_sync (
237+
id uuid not null primary key default uuid_generate_v4(),
238+
master_id uuid not null references public.masters on delete cascade,
239+
assigned_team_name varchar(100),
240+
assignee_name uuid references public.staffs on delete cascade,
241+
count int,
242+
delivered_at timestamp with time zone,
243+
deleted_at timestamp with time zone,
244+
created_at timestamp with time zone default timezone('utc' :: text, now()) not null,
245+
updated_at timestamp with time zone default timezone('utc' :: text, now()) not null
246+
);
247+
248+
alter table
249+
public.logs_status_master_sync enable row level security;
250+
251+
create policy "Allow select for all logs_status_master_sync." on public.logs_status_master_sync for
252+
select
253+
using (true);
254+
255+
create policy "Allow insert for all logs_status_master_sync." on public.logs_status_master_sync for
256+
insert
257+
with check (true);
258+
259+
create policy "Allow update for all logs_status_master_sync." on public.logs_status_master_sync for
260+
update
261+
using (true);
262+
209263
-- *** Function definitions ***
210264
create
211265
or replace function public.create_admin_user() returns trigger as $ $ begin -- If user_role is 'admin', insert data into admin_users table

0 commit comments

Comments
 (0)