Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
7a0fb314c3
commit
e4b17c1f8c
@@ -657,8 +657,10 @@ export type Database = {
|
||||
id: string
|
||||
sort_order: number
|
||||
stage_key: string | null
|
||||
template_task_id: string | null
|
||||
title: string
|
||||
updated_at: string
|
||||
workflow_template_id: string | null
|
||||
}
|
||||
Insert: {
|
||||
assignee_id?: string | null
|
||||
@@ -671,8 +673,10 @@ export type Database = {
|
||||
id?: string
|
||||
sort_order?: number
|
||||
stage_key?: string | null
|
||||
template_task_id?: string | null
|
||||
title: string
|
||||
updated_at?: string
|
||||
workflow_template_id?: string | null
|
||||
}
|
||||
Update: {
|
||||
assignee_id?: string | null
|
||||
@@ -685,8 +689,10 @@ export type Database = {
|
||||
id?: string
|
||||
sort_order?: number
|
||||
stage_key?: string | null
|
||||
template_task_id?: string | null
|
||||
title?: string
|
||||
updated_at?: string
|
||||
workflow_template_id?: string | null
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
@@ -710,6 +716,20 @@ export type Database = {
|
||||
referencedRelation: "collection_workflow_stages"
|
||||
referencedColumns: ["key"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "collection_tasks_template_task_id_fkey"
|
||||
columns: ["template_task_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "workflow_template_tasks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "collection_tasks_workflow_template_id_fkey"
|
||||
columns: ["workflow_template_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "workflow_templates"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
collection_workflow_stages: {
|
||||
@@ -2701,6 +2721,7 @@ export type Database = {
|
||||
priority: Database["public"]["Enums"]["task_priority"]
|
||||
sort_order: number
|
||||
status: Database["public"]["Enums"]["task_status"]
|
||||
template_task_id: string | null
|
||||
title: string
|
||||
updated_at: string
|
||||
workflow_template_id: string | null
|
||||
@@ -2719,6 +2740,7 @@ export type Database = {
|
||||
priority?: Database["public"]["Enums"]["task_priority"]
|
||||
sort_order?: number
|
||||
status?: Database["public"]["Enums"]["task_status"]
|
||||
template_task_id?: string | null
|
||||
title: string
|
||||
updated_at?: string
|
||||
workflow_template_id?: string | null
|
||||
@@ -2737,6 +2759,7 @@ export type Database = {
|
||||
priority?: Database["public"]["Enums"]["task_priority"]
|
||||
sort_order?: number
|
||||
status?: Database["public"]["Enums"]["task_status"]
|
||||
template_task_id?: string | null
|
||||
title?: string
|
||||
updated_at?: string
|
||||
workflow_template_id?: string | null
|
||||
@@ -2756,6 +2779,13 @@ export type Database = {
|
||||
referencedRelation: "tasks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "tasks_template_task_id_fkey"
|
||||
columns: ["template_task_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "workflow_template_tasks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "tasks_workflow_template_id_fkey"
|
||||
columns: ["workflow_template_id"]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
-- Add template_task_id to tasks for sequential chaining
|
||||
ALTER TABLE public.tasks
|
||||
ADD COLUMN IF NOT EXISTS template_task_id uuid REFERENCES public.workflow_template_tasks(id) ON DELETE SET NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_tasks_template_task ON public.tasks(template_task_id);
|
||||
|
||||
-- Allow workflow_templates on collections too
|
||||
ALTER TABLE public.collection_tasks
|
||||
ADD COLUMN IF NOT EXISTS workflow_template_id uuid REFERENCES public.workflow_templates(id) ON DELETE SET NULL,
|
||||
ADD COLUMN IF NOT EXISTS template_task_id uuid REFERENCES public.workflow_template_tasks(id) ON DELETE SET NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_collection_tasks_workflow_template ON public.collection_tasks(workflow_template_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_collection_tasks_template_task ON public.collection_tasks(template_task_id);
|
||||
Reference in New Issue
Block a user