Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
531f30f0eb
commit
cf7961e8fb
@@ -1326,6 +1326,7 @@ export type Database = {
|
||||
events: {
|
||||
Row: {
|
||||
all_day: boolean
|
||||
assigned_to: string | null
|
||||
case_id: string | null
|
||||
client_id: string | null
|
||||
created_at: string
|
||||
@@ -1342,6 +1343,7 @@ export type Database = {
|
||||
}
|
||||
Insert: {
|
||||
all_day?: boolean
|
||||
assigned_to?: string | null
|
||||
case_id?: string | null
|
||||
client_id?: string | null
|
||||
created_at?: string
|
||||
@@ -1358,6 +1360,7 @@ export type Database = {
|
||||
}
|
||||
Update: {
|
||||
all_day?: boolean
|
||||
assigned_to?: string | null
|
||||
case_id?: string | null
|
||||
client_id?: string | null
|
||||
created_at?: string
|
||||
@@ -1373,6 +1376,13 @@ export type Database = {
|
||||
updated_at?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "events_assigned_to_fkey"
|
||||
columns: ["assigned_to"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "profiles"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "events_case_id_fkey"
|
||||
columns: ["case_id"]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
ALTER TABLE public.events
|
||||
ADD COLUMN IF NOT EXISTS assigned_to uuid REFERENCES public.profiles(id) ON DELETE SET NULL;
|
||||
|
||||
-- Backfill existing rows: assignee = creator
|
||||
UPDATE public.events SET assigned_to = created_by WHERE assigned_to IS NULL AND created_by IS NOT NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS events_assigned_to_idx ON public.events(assigned_to);
|
||||
Reference in New Issue
Block a user