diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-03 21:54:29 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-03 21:55:07 +0100 |
| commit | 89eeeb9075acec512111c9f78ed8158a556e06e4 (patch) | |
| tree | 23ab351a1a6d09255bd12f7866908761f8a473bd /schema.sql | |
| parent | 587d8fe65d61b8f7217b4e8850b44e43159c16fb (diff) | |
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 |