From 5f96a63e0556818d91c45ffc998ab50f9db93839 Mon Sep 17 00:00:00 2001 From: Lim Ding Wen Date: Wed, 7 Aug 2024 04:09:17 +0800 Subject: [PATCH] Update types (for debate_bill_match_view) --- site/src/utils/supabase/database.types.ts | 94 +++++++++++++++++++++-- supabase/functions/database.types.ts | 94 +++++++++++++++++++++-- 2 files changed, 176 insertions(+), 12 deletions(-) diff --git a/site/src/utils/supabase/database.types.ts b/site/src/utils/supabase/database.types.ts index 8fb541c..5cfaaa8 100644 --- a/site/src/utils/supabase/database.types.ts +++ b/site/src/utils/supabase/database.types.ts @@ -23,7 +23,6 @@ export type Database = { second_reading_date: string | null second_reading_date_type: string summary: string | null - summary_backup: string | null } Insert: { bill_no: string @@ -38,7 +37,6 @@ export type Database = { second_reading_date?: string | null second_reading_date_type: string summary?: string | null - summary_backup?: string | null } Update: { bill_no?: string @@ -53,7 +51,6 @@ export type Database = { second_reading_date?: string | null second_reading_date_type?: string summary?: string | null - summary_backup?: string | null } Relationships: [] } @@ -65,7 +62,6 @@ export type Database = { order_no: number sitting_id: number summary: string | null - summary_backup: string | null title: string } Insert: { @@ -75,7 +71,6 @@ export type Database = { order_no: number sitting_id: number summary?: string | null - summary_backup?: string | null title: string } Update: { @@ -85,7 +80,6 @@ export type Database = { order_no?: number sitting_id?: number summary?: string | null - summary_backup?: string | null title?: string } Relationships: [ @@ -96,6 +90,13 @@ export type Database = { referencedRelation: "bill" referencedColumns: ["id"] }, + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["bill_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["bill_id"] + }, { foreignKeyName: "debate_sitting_id_fkey" columns: ["sitting_id"] @@ -110,6 +111,7 @@ export type Database = { content: string created_at: string debate_id: number + fill_debate_speaker_ids_updated_at: string id: number order_no: number speaker_id: number | null @@ -119,6 +121,7 @@ export type Database = { content: string created_at?: string debate_id: number + fill_debate_speaker_ids_updated_at?: string id?: number order_no: number speaker_id?: number | null @@ -128,6 +131,7 @@ export type Database = { content?: string created_at?: string debate_id?: number + fill_debate_speaker_ids_updated_at?: string id?: number order_no?: number speaker_id?: number | null @@ -141,6 +145,13 @@ export type Database = { referencedRelation: "debate" referencedColumns: ["id"] }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["debate_id"] + }, { foreignKeyName: "debate_speech_debate_id_fkey" columns: ["debate_id"] @@ -345,6 +356,24 @@ export type Database = { } } Views: { + bill_full_text_view: { + Row: { + bill_no: string | null + full_text: string | null + name: string | null + } + Insert: { + bill_no?: string | null + full_text?: never + name?: string | null + } + Update: { + bill_no?: string | null + full_text?: never + name?: string | null + } + Relationships: [] + } combined_mp_names_view: { Row: { alias_name: string | null @@ -353,6 +382,29 @@ export type Database = { } Relationships: [] } + debate_bill_match_view: { + Row: { + bill_id: number | null + debate_bill_id: number | null + debate_id: number | null + } + Relationships: [ + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["debate_bill_id"] + isOneToOne: false + referencedRelation: "bill" + referencedColumns: ["id"] + }, + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["debate_bill_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["bill_id"] + }, + ] + } debate_sortable_view: { Row: { id: number | null @@ -363,6 +415,36 @@ export type Database = { } Relationships: [] } + debate_speech_full_text_view: { + Row: { + debate_id: number | null + full_text: string | null + title: string | null + } + Relationships: [ + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate" + referencedColumns: ["id"] + }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["debate_id"] + }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_sortable_view" + referencedColumns: ["id"] + }, + ] + } unscraped_sitting_dates_view: { Row: { created_at: string | null diff --git a/supabase/functions/database.types.ts b/supabase/functions/database.types.ts index 8fb541c..5cfaaa8 100644 --- a/supabase/functions/database.types.ts +++ b/supabase/functions/database.types.ts @@ -23,7 +23,6 @@ export type Database = { second_reading_date: string | null second_reading_date_type: string summary: string | null - summary_backup: string | null } Insert: { bill_no: string @@ -38,7 +37,6 @@ export type Database = { second_reading_date?: string | null second_reading_date_type: string summary?: string | null - summary_backup?: string | null } Update: { bill_no?: string @@ -53,7 +51,6 @@ export type Database = { second_reading_date?: string | null second_reading_date_type?: string summary?: string | null - summary_backup?: string | null } Relationships: [] } @@ -65,7 +62,6 @@ export type Database = { order_no: number sitting_id: number summary: string | null - summary_backup: string | null title: string } Insert: { @@ -75,7 +71,6 @@ export type Database = { order_no: number sitting_id: number summary?: string | null - summary_backup?: string | null title: string } Update: { @@ -85,7 +80,6 @@ export type Database = { order_no?: number sitting_id?: number summary?: string | null - summary_backup?: string | null title?: string } Relationships: [ @@ -96,6 +90,13 @@ export type Database = { referencedRelation: "bill" referencedColumns: ["id"] }, + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["bill_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["bill_id"] + }, { foreignKeyName: "debate_sitting_id_fkey" columns: ["sitting_id"] @@ -110,6 +111,7 @@ export type Database = { content: string created_at: string debate_id: number + fill_debate_speaker_ids_updated_at: string id: number order_no: number speaker_id: number | null @@ -119,6 +121,7 @@ export type Database = { content: string created_at?: string debate_id: number + fill_debate_speaker_ids_updated_at?: string id?: number order_no: number speaker_id?: number | null @@ -128,6 +131,7 @@ export type Database = { content?: string created_at?: string debate_id?: number + fill_debate_speaker_ids_updated_at?: string id?: number order_no?: number speaker_id?: number | null @@ -141,6 +145,13 @@ export type Database = { referencedRelation: "debate" referencedColumns: ["id"] }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["debate_id"] + }, { foreignKeyName: "debate_speech_debate_id_fkey" columns: ["debate_id"] @@ -345,6 +356,24 @@ export type Database = { } } Views: { + bill_full_text_view: { + Row: { + bill_no: string | null + full_text: string | null + name: string | null + } + Insert: { + bill_no?: string | null + full_text?: never + name?: string | null + } + Update: { + bill_no?: string | null + full_text?: never + name?: string | null + } + Relationships: [] + } combined_mp_names_view: { Row: { alias_name: string | null @@ -353,6 +382,29 @@ export type Database = { } Relationships: [] } + debate_bill_match_view: { + Row: { + bill_id: number | null + debate_bill_id: number | null + debate_id: number | null + } + Relationships: [ + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["debate_bill_id"] + isOneToOne: false + referencedRelation: "bill" + referencedColumns: ["id"] + }, + { + foreignKeyName: "debate_bill_id_fkey" + columns: ["debate_bill_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["bill_id"] + }, + ] + } debate_sortable_view: { Row: { id: number | null @@ -363,6 +415,36 @@ export type Database = { } Relationships: [] } + debate_speech_full_text_view: { + Row: { + debate_id: number | null + full_text: string | null + title: string | null + } + Relationships: [ + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate" + referencedColumns: ["id"] + }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_bill_match_view" + referencedColumns: ["debate_id"] + }, + { + foreignKeyName: "debate_speech_debate_id_fkey" + columns: ["debate_id"] + isOneToOne: false + referencedRelation: "debate_sortable_view" + referencedColumns: ["id"] + }, + ] + } unscraped_sitting_dates_view: { Row: { created_at: string | null