1. สมัครใช้งานที่ supabase.com และสร้างโปรเจกต์ใหม่
2. ไปที่เมนู SQL Editor และรันโค้ด SQL ด้านล่างนี้เพื่อเปิดตารางข้อมูล:
create table wishes (
id bigint generated by default as identity primary key,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
sender text,
text text,
color text,
emoji text,
rotation integer,
is_gift boolean default false,
gift_opened boolean default false,
image text -- คอลัมน์เก็บไฟล์ภาพอวยพร (Base64)
);
-- ปลดล็อกสิทธิ์ความปลอดภัยให้อ่านเขียนทั่วไปได้
alter table wishes enable row level security;
create policy "Public access" on wishes for all using (true) with check (true);
-- หมายเหตุ: สำหรับตารางเดิมที่มีอยู่แล้ว ให้รันโค้ดด้านล่างเพื่อเพิ่มคอลัมน์เก็บภาพประกอบ:
-- alter table wishes add column image text;
3. ก๊อปปี้ Project URL และ Anon Key จากหน้าระบบมาใส่ฟอร์มด้านบนแล้วบันทึกได้ทันที!