refactor: simpler timing inputs

This commit is contained in:
Barf-Vader
2025-06-13 02:57:23 +01:00
parent 07742ad405
commit 8be06bba8b
14 changed files with 400 additions and 140 deletions

View File

@@ -43,10 +43,10 @@ CREATE TABLE reports (
CREATE TABLE study_space_hours (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
study_space_id UUID REFERENCES study_spaces(id) ON DELETE CASCADE,
day_of_week INT CHECK (day_of_week BETWEEN 0 AND 6), -- 0 = Sunday, 6 = Saturday
day_of_week INT CHECK (day_of_week BETWEEN 0 AND 6) NOT NULL, -- 0 = Sunday, 6 = Saturday
opens_at TIME NOT NULL,
closes_at TIME NOT NULL,
is_24_7 BOOLEAN DEFAULT FALSE,
open_today_status BOOLEAN,
created_at timestamp with time zone DEFAULT now(),
updated_at timestamp with time zone DEFAULT now()
);

View File

@@ -2,7 +2,7 @@ CREATE TABLE users (
id uuid PRIMARY KEY REFERENCES auth.users ON DELETE CASCADE,
is_admin boolean NOT NULL DEFAULT false,
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone NOT NULL DEFAULT now()
);
CREATE TRIGGER users_handle_updated_at