mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-17 14:17:14 -04:00
22 lines
699 B
SQL
22 lines
699 B
SQL
CREATE TABLE IF NOT EXISTS love_questions (
|
|
answer_type TEXT DEFAULT 'free_response' NOT NULL,
|
|
created_time TIMESTAMPTZ DEFAULT now() NOT NULL,
|
|
creator_id TEXT NOT NULL,
|
|
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
|
importance_score NUMERIC DEFAULT 0 NOT NULL,
|
|
multiple_choice_options JSONB,
|
|
question TEXT NOT NULL
|
|
);
|
|
|
|
-- Row Level Security
|
|
ALTER TABLE love_questions ENABLE ROW LEVEL SECURITY;
|
|
|
|
-- Policies
|
|
DROP POLICY IF EXISTS "public read" ON love_questions;
|
|
CREATE POLICY "public read" ON love_questions
|
|
FOR ALL USING (true);
|
|
|
|
-- Indexes
|
|
-- The primary key automatically creates a unique index on (id),
|
|
-- so the explicit index on id is redundant and removed.
|