Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions backend/supabase/migrations/20260114055101_users_table.sql
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only index I see needed atm

Original file line number Diff line number Diff line change
@@ -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;