From 6997b59cec610bf60a07d916a009995b82c9dee2 Mon Sep 17 00:00:00 2001 From: Dao Ho <84757503+Dao-Ho@users.noreply.github.com> Date: Wed, 14 Jan 2026 00:52:40 -0500 Subject: [PATCH 1/3] users table --- .../migrations/20260114055101_users_table.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backend/supabase/migrations/20260114055101_users_table.sql diff --git a/backend/supabase/migrations/20260114055101_users_table.sql b/backend/supabase/migrations/20260114055101_users_table.sql new file mode 100644 index 0000000..5c74547 --- /dev/null +++ b/backend/supabase/migrations/20260114055101_users_table.sql @@ -0,0 +1,16 @@ +-- Create users table +create table if not exists public.users ( + id uuid primary key default gen_random_uuid(), + first_name text not null, + last_name text not null, + employee_id text unique, + profile_picture text, + role text not null, + department text, + timezone text default 'UTC', + created_at timestamptz default now(), + updated_at timestamptz default now() +); + +-- Enable RLS +alter table public.users enable row level security; \ No newline at end of file From 154e2200b0f6a3c536a39192e0112df3e9b9970d Mon Sep 17 00:00:00 2001 From: Dao Ho <84757503+Dao-Ho@users.noreply.github.com> Date: Wed, 14 Jan 2026 00:54:20 -0500 Subject: [PATCH 2/3] feat: users index --- .../supabase/migrations/20260114055356_users_employee_index.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 backend/supabase/migrations/20260114055356_users_employee_index.sql diff --git a/backend/supabase/migrations/20260114055356_users_employee_index.sql b/backend/supabase/migrations/20260114055356_users_employee_index.sql new file mode 100644 index 0000000..08e8b34 --- /dev/null +++ b/backend/supabase/migrations/20260114055356_users_employee_index.sql @@ -0,0 +1,2 @@ +-- Create index on users table for employee_id +create index if not exists idx_users_employee_id on public.users(employee_id); \ No newline at end of file From 02fba256df8813650617320a68dd7a723c0cba1c Mon Sep 17 00:00:00 2001 From: Dao Ho <84757503+Dao-Ho@users.noreply.github.com> Date: Wed, 14 Jan 2026 01:03:49 -0500 Subject: [PATCH 3/3] hotels table migration --- .../20260114055934_create_requests_table.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 backend/supabase/migrations/20260114055934_create_requests_table.sql diff --git a/backend/supabase/migrations/20260114055934_create_requests_table.sql b/backend/supabase/migrations/20260114055934_create_requests_table.sql new file mode 100644 index 0000000..8190d08 --- /dev/null +++ b/backend/supabase/migrations/20260114055934_create_requests_table.sql @@ -0,0 +1,25 @@ +-- Create requests table +create table if not exists public.requests ( + id uuid primary key default gen_random_uuid(), + hotel_id uuid not null references public.hotels(id) on delete cascade, + guest_id uuid, + user_id uuid references public.users(id) on delete set null, + reservation_id text, + name text not null, + description text, + room_id text, + request_category text, + request_type text not null, + department text, + status text not null, + priority text not null, + estimated_completion_time integer, -- in minutes + scheduled_time timestamptz, + completed_at timestamptz, + notes text not null, + created_at timestamptz default now(), + updated_at timestamptz default now() +); + +-- Enable RLS +alter table public.requests enable row level security;