refactor: simpler timing inputs
This commit is contained in:
5
supabase/migrations/20250612170906_renamed-247.sql
Normal file
5
supabase/migrations/20250612170906_renamed-247.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
alter table "public"."study_space_hours" drop column "is_24_7";
|
||||
|
||||
alter table "public"."study_space_hours" add column "open_today_status" boolean;
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
alter table "public"."study_space_hours" alter column "day_of_week" set not null;
|
||||
|
||||
|
||||
@@ -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