From 0e074e9301e7a5bced3c4e92f0f33428fea181b1 Mon Sep 17 00:00:00 2001 From: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com> Date: Thu, 5 Jun 2025 17:38:49 +0100 Subject: [PATCH] feat: Added avaliable tags and tag column to table Coauthored-by: gk1623 --- src/lib/index.ts | 22 ++++++++++++++++++++++ supabase/schemas/0001_study_spaces.sql | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/lib/index.ts b/src/lib/index.ts index b2b0920..72ed306 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -3,3 +3,25 @@ import type { Database } from "./database.d.ts"; export type Table = Database["public"]["Tables"][T]["Row"]; export type Enum = Database["public"]["Enums"][T]; + +export const availableStudySpaceTags = [ + "Quiet", + "Loud", + "Silent", + "Group study", + "Individual study", + "Power outlets", + "No power outlets", + "24/7", + "Food allowed", + "No food allowed", + "Good wifi", + "Bad wifi", + "No wifi", + "Whiteboard", + "Restricted access", + "Hot", + "Air conditioned", + "Cold", + "Cringe" +]; diff --git a/supabase/schemas/0001_study_spaces.sql b/supabase/schemas/0001_study_spaces.sql index 1e07cee..57ec924 100644 --- a/supabase/schemas/0001_study_spaces.sql +++ b/supabase/schemas/0001_study_spaces.sql @@ -12,6 +12,7 @@ CREATE TABLE study_spaces ( -- Location within building, e.g., "Room 101" location text, building_location text, + tags text[] NOT NULL DEFAULT array[]::text[], created_at timestamp with time zone DEFAULT now(), updated_at timestamp with time zone DEFAULT now() ); @@ -24,6 +25,7 @@ CREATE TABLE study_space_images ( PRIMARY KEY (study_space_id, image_path) ); + -- Triggers CREATE TRIGGER study_spaces_updated_at AFTER UPDATE ON study_spaces