feat: Added avaliable tags and tag column to table #34

Merged
al4423 merged 2 commits from tags-setup into master 2025-06-05 16:49:36 +00:00
6 changed files with 173 additions and 7 deletions
Showing only changes of commit 0e074e9301 - Show all commits

View File

@@ -3,3 +3,25 @@ import type { Database } from "./database.d.ts";
export type Table<T extends keyof Database["public"]["Tables"]> =
Database["public"]["Tables"][T]["Row"];
export type Enum<T extends keyof Database["public"]["Enums"]> = 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"
];

View File

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