Fix search_path on functions

The migration succeeded but security warnings require updating functions to set search_path. Add SET search_path to the three created functions to ensure proper schema resolution and security context.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 01:58:56 +00:00
parent 01aba7df90
commit 5a8caa51b6
2 changed files with 457 additions and 0 deletions

View File

@@ -151,6 +151,57 @@ export type Database = {
}
Relationships: []
}
alert_correlation_rules: {
Row: {
alert_patterns: Json
auto_create_incident: boolean
created_at: string
created_by: string | null
description: string | null
enabled: boolean
id: string
incident_description_template: string | null
incident_severity: string
incident_title_template: string
min_alerts_required: number
rule_name: string
time_window_minutes: number
updated_at: string
}
Insert: {
alert_patterns: Json
auto_create_incident?: boolean
created_at?: string
created_by?: string | null
description?: string | null
enabled?: boolean
id?: string
incident_description_template?: string | null
incident_severity: string
incident_title_template: string
min_alerts_required?: number
rule_name: string
time_window_minutes?: number
updated_at?: string
}
Update: {
alert_patterns?: Json
auto_create_incident?: boolean
created_at?: string
created_by?: string | null
description?: string | null
enabled?: boolean
id?: string
incident_description_template?: string | null
incident_severity?: string
incident_title_template?: string
min_alerts_required?: number
rule_name?: string
time_window_minutes?: number
updated_at?: string
}
Relationships: []
}
approval_transaction_metrics: {
Row: {
created_at: string | null
@@ -1551,6 +1602,110 @@ export type Database = {
},
]
}
incident_alerts: {
Row: {
added_at: string
alert_id: string
alert_source: string
id: string
incident_id: string
}
Insert: {
added_at?: string
alert_id: string
alert_source: string
id?: string
incident_id: string
}
Update: {
added_at?: string
alert_id?: string
alert_source?: string
id?: string
incident_id?: string
}
Relationships: [
{
foreignKeyName: "incident_alerts_incident_id_fkey"
columns: ["incident_id"]
isOneToOne: false
referencedRelation: "incidents"
referencedColumns: ["id"]
},
]
}
incidents: {
Row: {
acknowledged_at: string | null
acknowledged_by: string | null
alert_count: number
correlation_rule_id: string | null
created_at: string
description: string | null
detected_at: string
id: string
incident_number: string
resolution_notes: string | null
resolved_at: string | null
resolved_by: string | null
severity: string
status: string
title: string
updated_at: string
}
Insert: {
acknowledged_at?: string | null
acknowledged_by?: string | null
alert_count?: number
correlation_rule_id?: string | null
created_at?: string
description?: string | null
detected_at?: string
id?: string
incident_number: string
resolution_notes?: string | null
resolved_at?: string | null
resolved_by?: string | null
severity: string
status?: string
title: string
updated_at?: string
}
Update: {
acknowledged_at?: string | null
acknowledged_by?: string | null
alert_count?: number
correlation_rule_id?: string | null
created_at?: string
description?: string | null
detected_at?: string
id?: string
incident_number?: string
resolution_notes?: string | null
resolved_at?: string | null
resolved_by?: string | null
severity?: string
status?: string
title?: string
updated_at?: string
}
Relationships: [
{
foreignKeyName: "incidents_correlation_rule_id_fkey"
columns: ["correlation_rule_id"]
isOneToOne: false
referencedRelation: "alert_correlation_rules"
referencedColumns: ["id"]
},
{
foreignKeyName: "incidents_correlation_rule_id_fkey"
columns: ["correlation_rule_id"]
isOneToOne: false
referencedRelation: "alert_correlations_view"
referencedColumns: ["rule_id"]
},
]
}
item_change_fields: {
Row: {
created_at: string | null
@@ -5838,6 +5993,25 @@ export type Database = {
}
}
Views: {
alert_correlations_view: {
Row: {
alert_ids: string[] | null
alert_messages: string[] | null
alert_sources: string[] | null
can_create_incident: boolean | null
first_alert_at: string | null
incident_severity: string | null
incident_title_template: string | null
last_alert_at: string | null
matching_alerts_count: number | null
min_alerts_required: number | null
rule_description: string | null
rule_id: string | null
rule_name: string | null
time_window_minutes: number | null
}
Relationships: []
}
error_summary: {
Row: {
affected_users: number | null
@@ -6246,6 +6420,7 @@ export type Database = {
}
extract_cf_image_id: { Args: { url: string }; Returns: string }
generate_deletion_confirmation_code: { Args: never; Returns: string }
generate_incident_number: { Args: never; Returns: string }
generate_notification_idempotency_key: {
Args: {
p_entity_id: string