From 89eeeb9075acec512111c9f78ed8158a556e06e4 Mon Sep 17 00:00:00 2001
From: Ruben Beltran del Rio <jj@r.bdr.sh>
Date: Wed, 3 Dec 2025 21:54:29 +0100
Subject: Save WIP Again.

---
 schema.sql | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 schema.sql

(limited to 'schema.sql')

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
-- 
cgit 

