์กฐ๋ณ ์ธก์ ๊ฐ์ ๋ฃ์ผ๋ฉด ๋ฐ ์ ์ฒด ๊ทธ๋ํ๊ฐ ์ค์๊ฐ์ผ๋ก ์์ฑ๋ฉ๋๋ค
โ ์ค์๊ฐ ๊ณต์ ์ผ๊ธฐ: ์๋ SQL์ Supabase์ SQL Editor์ ๋ถ์ฌ๋ฃ๊ณ Run ํ๋ฉด, ๋ชจ๋ ๊ธฐ๊ธฐ๊ฐ ๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ์ค์๊ฐ์ผ๋ก ๊ณต์ ํฉ๋๋ค. (์ ํ๋ฉด ์ด ๊ธฐ๊ธฐ ์์์๋ง ์๋ํ๋ ์ฐ์ต ๋ชจ๋)
create table if not exists science_measure (
id uuid primary key default gen_random_uuid(),
created_at timestamptz not null default now(),
room text not null default 'demo',
team text,
x double precision not null,
y double precision not null
);
create index if not exists science_measure_room_idx
on science_measure(room, created_at desc);
alter table science_measure enable row level security;
drop policy if exists "anon insert science" on science_measure;
create policy "anon insert science" on science_measure
for insert to anon
with check ( char_length(room) between 1 and 40
and x between -1000000 and 1000000
and y between -1000000 and 1000000 );
drop policy if exists "anon read science" on science_measure;
create policy "anon read science" on science_measure
for select to anon using ( true );
โก ์คํ์ ๋ง๊ฒ ์ถ ๋ฐ๊พธ๊ธฐ: ์ฃผ์ ๋ค์ ๋ถ์ด์ธ์ โ
?x=์จ๋(โ)&y=๋
น์ ์(g) ยท ?x=์ ์(V)&y=์ ๋ฅ(A) ์ฒ๋ผ.
๋ฐ ๊ตฌ๋ถ์ ?room=3-2 (์ฌ๋ฌ ํญ๋ชฉ์ &๋ก ์ฐ๊ฒฐ).
โข ๋ฐ์ดํฐ ์ง์ฐ๊ธฐ: SQL Editor์์ delete from science_measure;