refactor: simpler timing inputs
This commit is contained in:
@@ -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()
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user