Fix park submission locations

Implement Phase 1 of the JSONB violation fix by creating the `park_submission_locations` table. This includes migrating existing data from `park_submissions.temp_location_data` and updating relevant code to read and write to the new relational table. The `temp_location_data` column will be dropped after data migration.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-06 15:45:12 +00:00
parent 1a4e30674f
commit 5b0ac813e2
8 changed files with 379 additions and 124 deletions

View File

@@ -2006,6 +2006,65 @@ export type Database = {
},
]
}
park_submission_locations: {
Row: {
city: string | null
country: string
created_at: string
display_name: string | null
id: string
latitude: number | null
longitude: number | null
name: string
park_submission_id: string
postal_code: string | null
state_province: string | null
street_address: string | null
timezone: string | null
updated_at: string
}
Insert: {
city?: string | null
country: string
created_at?: string
display_name?: string | null
id?: string
latitude?: number | null
longitude?: number | null
name: string
park_submission_id: string
postal_code?: string | null
state_province?: string | null
street_address?: string | null
timezone?: string | null
updated_at?: string
}
Update: {
city?: string | null
country?: string
created_at?: string
display_name?: string | null
id?: string
latitude?: number | null
longitude?: number | null
name?: string
park_submission_id?: string
postal_code?: string | null
state_province?: string | null
street_address?: string | null
timezone?: string | null
updated_at?: string
}
Relationships: [
{
foreignKeyName: "park_submission_locations_park_submission_id_fkey"
columns: ["park_submission_id"]
isOneToOne: false
referencedRelation: "park_submissions"
referencedColumns: ["id"]
},
]
}
park_submissions: {
Row: {
banner_image_id: string | null
@@ -2029,7 +2088,6 @@ export type Database = {
slug: string
status: string
submission_id: string
temp_location_data: Json | null
updated_at: string
website_url: string | null
}
@@ -2055,7 +2113,6 @@ export type Database = {
slug: string
status?: string
submission_id: string
temp_location_data?: Json | null
updated_at?: string
website_url?: string | null
}
@@ -2081,7 +2138,6 @@ export type Database = {
slug?: string
status?: string
submission_id?: string
temp_location_data?: Json | null
updated_at?: string
website_url?: string | null
}