Files
HKSingleParty/03_source/mobile_old.del/docker/supabase/migrations/09070_todo.sql
2025-05-28 09:55:51 +08:00

30 lines
562 B
PL/PgSQL

-- Create a table called "todos"
-- with a column to store tasks.
BEGIN;
DROP TABLE IF EXISTS "todos";
CREATE TABLE todos(
id serial PRIMARY KEY,
task text
);
-- Turn on security
ALTER TABLE "todos" ENABLE ROW LEVEL SECURITY;
-- Allow anonymous access
CREATE POLICY "Allow public access" ON todos
FOR SELECT TO anon
USING (TRUE);
-- Turn on security
ALTER TABLE "todos" ENABLE ROW LEVEL SECURITY;
-- Add some data
INSERT INTO todos(task)
VALUES
('Create tables'),
('Enable security'),
('Add data'),
('Fetch data from the API');
COMMIT;