Skip to content

Commit

Permalink
Update DB types to include Wikidata IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
limdingwen committed Jul 26, 2024
1 parent 1a089b6 commit d0ce430
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 14 deletions.
37 changes: 30 additions & 7 deletions site/src/utils/supabase/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type Database = {
bill_id: number | null
created_at: string
id: number
order_no: number
sitting_id: number
summary: string | null
title: string
Expand All @@ -67,6 +68,7 @@ export type Database = {
bill_id?: number | null
created_at?: string
id?: number
order_no: number
sitting_id: number
summary?: string | null
title: string
Expand All @@ -75,6 +77,7 @@ export type Database = {
bill_id?: number | null
created_at?: string
id?: number
order_no?: number
sitting_id?: number
summary?: string | null
title?: string
Expand Down Expand Up @@ -102,20 +105,23 @@ export type Database = {
created_at: string
debate_id: number
id: number
order_no: number
speaker_id: number | null
}
Insert: {
content: string
created_at?: string
debate_id: number
id?: number
order_no: number
speaker_id?: number | null
}
Update: {
content?: string
created_at?: string
debate_id?: number
id?: number
order_no?: number
speaker_id?: number | null
}
Relationships: [
Expand All @@ -140,40 +146,40 @@ export type Database = {
created_at: string
date_of_birth: string | null
family_name: string | null
full_name: string | null
full_name: string
gender: string | null
given_name: string | null
id: number
name: string | null
party_id: number | null
photo_url: string | null
place_of_birth: string | null
wikidata_id: string
}
Insert: {
created_at?: string
date_of_birth?: string | null
family_name?: string | null
full_name?: string | null
full_name: string
gender?: string | null
given_name?: string | null
id?: number
name?: string | null
party_id?: number | null
photo_url?: string | null
place_of_birth?: string | null
wikidata_id: string
}
Update: {
created_at?: string
date_of_birth?: string | null
family_name?: string | null
full_name?: string | null
full_name?: string
gender?: string | null
given_name?: string | null
id?: number
name?: string | null
party_id?: number | null
photo_url?: string | null
place_of_birth?: string | null
wikidata_id?: string
}
Relationships: [
{
Expand All @@ -192,20 +198,23 @@ export type Database = {
id: number
name: string
photo_url: string | null
wikidata_id: string
}
Insert: {
colour: string
created_at?: string
id?: number
name: string
photo_url?: string | null
wikidata_id: string
}
Update: {
colour?: string
created_at?: string
id?: number
name?: string
photo_url?: string | null
wikidata_id?: string
}
Relationships: []
}
Expand Down Expand Up @@ -248,6 +257,13 @@ export type Database = {
referencedRelation: "sitting_date"
referencedColumns: ["id"]
},
{
foreignKeyName: "sitting_info_sitting_id_fkey"
columns: ["sitting_date_id"]
isOneToOne: true
referencedRelation: "unscraped_sitting_dates_view"
referencedColumns: ["id"]
},
]
}
sitting_date: {
Expand All @@ -270,7 +286,14 @@ export type Database = {
}
}
Views: {
[_ in never]: never
unscraped_sitting_dates_view: {
Row: {
created_at: string | null
id: number | null
sitting_date: string | null
}
Relationships: []
}
}
Functions: {
[_ in never]: never
Expand Down
37 changes: 30 additions & 7 deletions supabase/functions/database.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type Database = {
bill_id: number | null
created_at: string
id: number
order_no: number
sitting_id: number
summary: string | null
title: string
Expand All @@ -67,6 +68,7 @@ export type Database = {
bill_id?: number | null
created_at?: string
id?: number
order_no: number
sitting_id: number
summary?: string | null
title: string
Expand All @@ -75,6 +77,7 @@ export type Database = {
bill_id?: number | null
created_at?: string
id?: number
order_no?: number
sitting_id?: number
summary?: string | null
title?: string
Expand Down Expand Up @@ -102,20 +105,23 @@ export type Database = {
created_at: string
debate_id: number
id: number
order_no: number
speaker_id: number | null
}
Insert: {
content: string
created_at?: string
debate_id: number
id?: number
order_no: number
speaker_id?: number | null
}
Update: {
content?: string
created_at?: string
debate_id?: number
id?: number
order_no?: number
speaker_id?: number | null
}
Relationships: [
Expand All @@ -140,40 +146,40 @@ export type Database = {
created_at: string
date_of_birth: string | null
family_name: string | null
full_name: string | null
full_name: string
gender: string | null
given_name: string | null
id: number
name: string | null
party_id: number | null
photo_url: string | null
place_of_birth: string | null
wikidata_id: string
}
Insert: {
created_at?: string
date_of_birth?: string | null
family_name?: string | null
full_name?: string | null
full_name: string
gender?: string | null
given_name?: string | null
id?: number
name?: string | null
party_id?: number | null
photo_url?: string | null
place_of_birth?: string | null
wikidata_id: string
}
Update: {
created_at?: string
date_of_birth?: string | null
family_name?: string | null
full_name?: string | null
full_name?: string
gender?: string | null
given_name?: string | null
id?: number
name?: string | null
party_id?: number | null
photo_url?: string | null
place_of_birth?: string | null
wikidata_id?: string
}
Relationships: [
{
Expand All @@ -192,20 +198,23 @@ export type Database = {
id: number
name: string
photo_url: string | null
wikidata_id: string
}
Insert: {
colour: string
created_at?: string
id?: number
name: string
photo_url?: string | null
wikidata_id: string
}
Update: {
colour?: string
created_at?: string
id?: number
name?: string
photo_url?: string | null
wikidata_id?: string
}
Relationships: []
}
Expand Down Expand Up @@ -248,6 +257,13 @@ export type Database = {
referencedRelation: "sitting_date"
referencedColumns: ["id"]
},
{
foreignKeyName: "sitting_info_sitting_id_fkey"
columns: ["sitting_date_id"]
isOneToOne: true
referencedRelation: "unscraped_sitting_dates_view"
referencedColumns: ["id"]
},
]
}
sitting_date: {
Expand All @@ -270,7 +286,14 @@ export type Database = {
}
}
Views: {
[_ in never]: never
unscraped_sitting_dates_view: {
Row: {
created_at: string | null
id: number | null
sitting_date: string | null
}
Relationships: []
}
}
Functions: {
[_ in never]: never
Expand Down

0 comments on commit d0ce430

Please sign in to comment.