env | grep SUPABASE
SUPABASE_DB_PASSWORD=<redacted:SUPABASE_DB_PASSWORD> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> SUPABASE_URL=https://<ref>.supabase.co SUPABASE_SERVICE_ROLE_KEY=<redacted:SUPABASE_SERVICE_ROLE_KEY> SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=<redacted:SUPABASE_ANON_KEY>
cat << 'EOF' > schema.sql
CREATE TABLE authors (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text NOT NULL,
email text NOT NULL UNIQUE
);
CREATE TABLE courses (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
author_id uuid NOT NULL REFERENCES authors(id),
title text NOT NULL,
price_cents integer NOT NULL CHECK (price_cents >= 0),
published boolean NOT NULL DEFAULT false,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE enrollments (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
course_id uuid NOT NULL REFERENCES courses(id) ON DELETE CASCADE,
student_email text NOT NULL,
enrolled_at timestamptz NOT NULL DEFAULT now(),
UNIQUE(course_id, student_email)
);
CREATE INDEX idx_courses_author_id ON courses(author_id);
CREATE INDEX idx_enrollments_student_email ON enrollments(student_email);
-- Grant privileges to anon and authenticated roles
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO anon;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO authenticated;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO service_role;
EOF
cat << 'EOF' > schema.sql
CREATE TABLE public.authors (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text NOT NULL,
email text NOT NULL UNIQUE
);
CREATE TABLE public.courses (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
author_id uuid NOT NULL REFERENCES public.authors(id),
title text NOT NULL,
price_cents integer NOT NULL CHECK (price_cents >= 0),
published boolean NOT NULL DEFAULT false,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE public.enrollments (
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
course_id uuid NOT NULL REFERENCES public.courses(id) ON DELETE CASCADE,
student_email text NOT NULL,
enrolled_at timestamptz NOT NULL DEFAULT now(),
UNIQUE(course_id, student_email)
);
CREATE INDEX idx_courses_author_id ON public.courses(author_id);
CREATE INDEX idx_enrollments_student_email ON public.enrollments(student_email);
-- Ensure anon roles can access the tables (useful for PostgREST)
GRANT USAGE ON SCHEMA public TO anon, authenticated;
GRANT SELECT ON public.authors TO anon, authenticated;
GRANT SELECT ON public.courses TO anon, authenticated;
GRANT SELECT ON public.enrollments TO anon, authenticated;
-- Reload PostgREST schema cache
NOTIFY pgrst, 'reload schema';
EOF
psql -d "$SUPABASE_DB_URL" -f schema.sql
CREATE TABLE CREATE TABLE CREATE TABLE CREATE INDEX CREATE INDEX GRANT GRANT GRANT GRANT NOTIFY
curl -s -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY" "$SUPABASE_URL/rest/v1/courses"
[]
A shell script executed against the live project and asserted on the state the agent left behind. No model judged another model.
Raw transcript · Task definition and verifier · Every attempt