diff options
Diffstat (limited to 'schema.sql')
| -rw-r--r-- | schema.sql | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..f33c99f --- /dev/null +++ b/schema.sql @@ -0,0 +1,20 @@ +-- Canvas database schema + +-- Enable PostGIS extension for box data type support +-- Note: PostgreSQL has built-in box type, no need for PostGIS + +-- Create the widgets table +CREATE TABLE IF NOT EXISTS widgets ( + id SERIAL PRIMARY KEY, + box BOX NOT NULL, + created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), + updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() +); + +-- Create GiST index for efficient box queries +CREATE INDEX IF NOT EXISTS widgets_box_gist_idx ON widgets USING GIST (box); + +-- Add any additional columns that might exist in your Supabase table +-- You may need to adjust this based on your actual widget data structure +-- ALTER TABLE widgets ADD COLUMN IF NOT EXISTS name TEXT; +-- ALTER TABLE widgets ADD COLUMN IF NOT EXISTS data JSONB;
\ No newline at end of file |