export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[]

export type Database = {
  // Allows to automatically instantiate createClient with right options
  // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
  __InternalSupabase: {
    PostgrestVersion: "13.0.5"
  }
  public: {
    Tables: {
      account_deletion_requests: {
        Row: {
          cancellation_reason: string | null
          cancelled_at: string | null
          completed_at: string | null
          confirmation_code: string
          confirmation_code_sent_at: string | null
          created_at: string
          id: string
          requested_at: string
          scheduled_deletion_at: string
          status: Database["public"]["Enums"]["account_deletion_status"]
          updated_at: string
          user_id: string
        }
        Insert: {
          cancellation_reason?: string | null
          cancelled_at?: string | null
          completed_at?: string | null
          confirmation_code: string
          confirmation_code_sent_at?: string | null
          created_at?: string
          id?: string
          requested_at?: string
          scheduled_deletion_at: string
          status?: Database["public"]["Enums"]["account_deletion_status"]
          updated_at?: string
          user_id: string
        }
        Update: {
          cancellation_reason?: string | null
          cancelled_at?: string | null
          completed_at?: string | null
          confirmation_code?: string
          confirmation_code_sent_at?: string | null
          created_at?: string
          id?: string
          requested_at?: string
          scheduled_deletion_at?: string
          status?: Database["public"]["Enums"]["account_deletion_status"]
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
      admin_audit_log: {
        Row: {
          action: string
          admin_user_id: string
          auth0_event_type: string | null
          created_at: string
          details: Json | null
          id: string
          target_user_id: string
        }
        Insert: {
          action: string
          admin_user_id: string
          auth0_event_type?: string | null
          created_at?: string
          details?: Json | null
          id?: string
          target_user_id: string
        }
        Update: {
          action?: string
          admin_user_id?: string
          auth0_event_type?: string | null
          created_at?: string
          details?: Json | null
          id?: string
          target_user_id?: string
        }
        Relationships: []
      }
      admin_settings: {
        Row: {
          category: string
          created_at: string
          description: string | null
          id: string
          setting_key: string
          setting_value: Json
          updated_at: string
          updated_by: string | null
        }
        Insert: {
          category: string
          created_at?: string
          description?: string | null
          id?: string
          setting_key: string
          setting_value: Json
          updated_at?: string
          updated_by?: string | null
        }
        Update: {
          category?: string
          created_at?: string
          description?: string | null
          id?: string
          setting_key?: string
          setting_value?: Json
          updated_at?: string
          updated_by?: string | null
        }
        Relationships: []
      }
      blog_posts: {
        Row: {
          author_id: string
          content: string
          created_at: string | null
          featured_image_id: string | null
          featured_image_url: string | null
          id: string
          published_at: string | null
          slug: string
          status: string
          title: string
          updated_at: string | null
          view_count: number | null
        }
        Insert: {
          author_id: string
          content: string
          created_at?: string | null
          featured_image_id?: string | null
          featured_image_url?: string | null
          id?: string
          published_at?: string | null
          slug: string
          status?: string
          title: string
          updated_at?: string | null
          view_count?: number | null
        }
        Update: {
          author_id?: string
          content?: string
          created_at?: string | null
          featured_image_id?: string | null
          featured_image_url?: string | null
          id?: string
          published_at?: string | null
          slug?: string
          status?: string
          title?: string
          updated_at?: string | null
          view_count?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "blog_posts_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "blog_posts_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
        ]
      }
      companies: {
        Row: {
          average_rating: number | null
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          company_type: string
          created_at: string
          description: string | null
          founded_date: string | null
          founded_date_precision: string | null
          founded_year: number | null
          headquarters_location: string | null
          id: string
          is_test_data: boolean | null
          logo_url: string | null
          name: string
          person_type: string | null
          review_count: number | null
          slug: string
          updated_at: string
          view_count_30d: number | null
          view_count_7d: number | null
          view_count_all: number | null
          website_url: string | null
        }
        Insert: {
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          company_type: string
          created_at?: string
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          id?: string
          is_test_data?: boolean | null
          logo_url?: string | null
          name: string
          person_type?: string | null
          review_count?: number | null
          slug: string
          updated_at?: string
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          website_url?: string | null
        }
        Update: {
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          company_type?: string
          created_at?: string
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          id?: string
          is_test_data?: boolean | null
          logo_url?: string | null
          name?: string
          person_type?: string | null
          review_count?: number | null
          slug?: string
          updated_at?: string
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          website_url?: string | null
        }
        Relationships: []
      }
      company_submissions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          company_type: string
          created_at: string
          description: string | null
          founded_date: string | null
          founded_date_precision: string | null
          founded_year: number | null
          headquarters_location: string | null
          id: string
          logo_url: string | null
          name: string
          person_type: string | null
          slug: string
          submission_id: string
          updated_at: string
          website_url: string | null
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          company_type: string
          created_at?: string
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          id?: string
          logo_url?: string | null
          name: string
          person_type?: string | null
          slug: string
          submission_id: string
          updated_at?: string
          website_url?: string | null
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          company_type?: string
          created_at?: string
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          id?: string
          logo_url?: string | null
          name?: string
          person_type?: string | null
          slug?: string
          submission_id?: string
          updated_at?: string
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "company_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: true
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      company_versions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          change_reason: string | null
          change_type: Database["public"]["Enums"]["version_change_type"]
          company_id: string
          company_type: string
          created_at: string
          created_by: string | null
          description: string | null
          founded_date: string | null
          founded_date_precision: string | null
          founded_year: number | null
          headquarters_location: string | null
          is_current: boolean
          is_test_data: boolean | null
          logo_url: string | null
          name: string
          person_type: string | null
          slug: string
          submission_id: string | null
          version_id: string
          version_number: number
          website_url: string | null
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          company_id: string
          company_type: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          logo_url?: string | null
          name: string
          person_type?: string | null
          slug: string
          submission_id?: string | null
          version_id?: string
          version_number: number
          website_url?: string | null
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          company_id?: string
          company_type?: string
          created_at?: string
          created_by?: string | null
          description?: string | null
          founded_date?: string | null
          founded_date_precision?: string | null
          founded_year?: number | null
          headquarters_location?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          logo_url?: string | null
          name?: string
          person_type?: string | null
          slug?: string
          submission_id?: string | null
          version_id?: string
          version_number?: number
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "company_versions_company_id_fkey"
            columns: ["company_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "company_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "company_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "company_versions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      conflict_resolutions: {
        Row: {
          conflict_details: Json | null
          created_at: string
          detected_at: string
          id: string
          resolution_strategy: string
          resolved_by: string | null
          submission_id: string
        }
        Insert: {
          conflict_details?: Json | null
          created_at?: string
          detected_at?: string
          id?: string
          resolution_strategy: string
          resolved_by?: string | null
          submission_id: string
        }
        Update: {
          conflict_details?: Json | null
          created_at?: string
          detected_at?: string
          id?: string
          resolution_strategy?: string
          resolved_by?: string | null
          submission_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "conflict_resolutions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      contact_email_threads: {
        Row: {
          body_html: string | null
          body_text: string
          created_at: string
          direction: string
          from_email: string
          id: string
          in_reply_to: string | null
          message_id: string
          metadata: Json | null
          reference_chain: string[] | null
          sent_by: string | null
          subject: string
          submission_id: string
          to_email: string
        }
        Insert: {
          body_html?: string | null
          body_text: string
          created_at?: string
          direction: string
          from_email: string
          id?: string
          in_reply_to?: string | null
          message_id: string
          metadata?: Json | null
          reference_chain?: string[] | null
          sent_by?: string | null
          subject: string
          submission_id: string
          to_email: string
        }
        Update: {
          body_html?: string | null
          body_text?: string
          created_at?: string
          direction?: string
          from_email?: string
          id?: string
          in_reply_to?: string | null
          message_id?: string
          metadata?: Json | null
          reference_chain?: string[] | null
          sent_by?: string | null
          subject?: string
          submission_id?: string
          to_email?: string
        }
        Relationships: [
          {
            foreignKeyName: "contact_email_threads_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "contact_submissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_submission_cascade"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "contact_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      contact_rate_limits: {
        Row: {
          email: string
          last_submission_at: string
          submission_count: number
          window_start: string
        }
        Insert: {
          email: string
          last_submission_at?: string
          submission_count?: number
          window_start?: string
        }
        Update: {
          email?: string
          last_submission_at?: string
          submission_count?: number
          window_start?: string
        }
        Relationships: []
      }
      contact_submissions: {
        Row: {
          admin_notes: string | null
          archived_at: string | null
          archived_by: string | null
          assigned_to: string | null
          category: string
          created_at: string
          email: string
          id: string
          ip_address_hash: string | null
          last_admin_response_at: string | null
          merged_ticket_numbers: string[] | null
          message: string
          name: string
          resolved_at: string | null
          resolved_by: string | null
          response_count: number | null
          status: string
          subject: string
          submitter_profile_data: Json | null
          submitter_reputation: number | null
          submitter_username: string | null
          thread_id: string | null
          ticket_number: string | null
          updated_at: string
          user_agent: string | null
          user_id: string | null
        }
        Insert: {
          admin_notes?: string | null
          archived_at?: string | null
          archived_by?: string | null
          assigned_to?: string | null
          category: string
          created_at?: string
          email: string
          id?: string
          ip_address_hash?: string | null
          last_admin_response_at?: string | null
          merged_ticket_numbers?: string[] | null
          message: string
          name: string
          resolved_at?: string | null
          resolved_by?: string | null
          response_count?: number | null
          status?: string
          subject: string
          submitter_profile_data?: Json | null
          submitter_reputation?: number | null
          submitter_username?: string | null
          thread_id?: string | null
          ticket_number?: string | null
          updated_at?: string
          user_agent?: string | null
          user_id?: string | null
        }
        Update: {
          admin_notes?: string | null
          archived_at?: string | null
          archived_by?: string | null
          assigned_to?: string | null
          category?: string
          created_at?: string
          email?: string
          id?: string
          ip_address_hash?: string | null
          last_admin_response_at?: string | null
          merged_ticket_numbers?: string[] | null
          message?: string
          name?: string
          resolved_at?: string | null
          resolved_by?: string | null
          response_count?: number | null
          status?: string
          subject?: string
          submitter_profile_data?: Json | null
          submitter_reputation?: number | null
          submitter_username?: string | null
          thread_id?: string | null
          ticket_number?: string | null
          updated_at?: string
          user_agent?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      content_submissions: {
        Row: {
          approval_mode: string | null
          assigned_at: string | null
          assigned_to: string | null
          content: Json
          created_at: string
          escalated: boolean | null
          escalated_at: string | null
          escalated_by: string | null
          escalation_reason: string | null
          first_reviewed_at: string | null
          id: string
          is_test_data: boolean | null
          last_modified_at: string | null
          last_modified_by: string | null
          locked_until: string | null
          original_submission_id: string | null
          resolved_at: string | null
          review_count: number | null
          reviewed_at: string | null
          reviewer_id: string | null
          reviewer_notes: string | null
          status: string
          submission_type: string
          submitted_at: string
          updated_at: string
          user_id: string
        }
        Insert: {
          approval_mode?: string | null
          assigned_at?: string | null
          assigned_to?: string | null
          content: Json
          created_at?: string
          escalated?: boolean | null
          escalated_at?: string | null
          escalated_by?: string | null
          escalation_reason?: string | null
          first_reviewed_at?: string | null
          id?: string
          is_test_data?: boolean | null
          last_modified_at?: string | null
          last_modified_by?: string | null
          locked_until?: string | null
          original_submission_id?: string | null
          resolved_at?: string | null
          review_count?: number | null
          reviewed_at?: string | null
          reviewer_id?: string | null
          reviewer_notes?: string | null
          status?: string
          submission_type: string
          submitted_at?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          approval_mode?: string | null
          assigned_at?: string | null
          assigned_to?: string | null
          content?: Json
          created_at?: string
          escalated?: boolean | null
          escalated_at?: string | null
          escalated_by?: string | null
          escalation_reason?: string | null
          first_reviewed_at?: string | null
          id?: string
          is_test_data?: boolean | null
          last_modified_at?: string | null
          last_modified_by?: string | null
          locked_until?: string | null
          original_submission_id?: string | null
          resolved_at?: string | null
          review_count?: number | null
          reviewed_at?: string | null
          reviewer_id?: string | null
          reviewer_notes?: string | null
          status?: string
          submission_type?: string
          submitted_at?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "content_submissions_assigned_to_fkey"
            columns: ["assigned_to"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_assigned_to_fkey"
            columns: ["assigned_to"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_escalated_by_fkey"
            columns: ["escalated_by"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_escalated_by_fkey"
            columns: ["escalated_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_original_submission_id_fkey"
            columns: ["original_submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "content_submissions_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "content_submissions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
        ]
      }
      email_aliases: {
        Row: {
          created_at: string
          description: string | null
          email: string
          id: string
          key: string
          owner_id: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          email: string
          id?: string
          key: string
          owner_id?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          description?: string | null
          email?: string
          id?: string
          key?: string
          owner_id?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      entity_page_views: {
        Row: {
          created_at: string | null
          entity_id: string
          entity_type: string
          id: string
          session_hash: string | null
          viewed_at: string | null
        }
        Insert: {
          created_at?: string | null
          entity_id: string
          entity_type: string
          id?: string
          session_hash?: string | null
          viewed_at?: string | null
        }
        Update: {
          created_at?: string | null
          entity_id?: string
          entity_type?: string
          id?: string
          session_hash?: string | null
          viewed_at?: string | null
        }
        Relationships: []
      }
      entity_timeline_events: {
        Row: {
          approved_by: string | null
          created_at: string
          created_by: string | null
          description: string | null
          display_order: number | null
          entity_id: string
          entity_type: string
          event_date: string
          event_date_precision: string | null
          event_type: string
          from_entity_id: string | null
          from_location_id: string | null
          from_value: string | null
          id: string
          is_public: boolean
          submission_id: string | null
          title: string
          to_entity_id: string | null
          to_location_id: string | null
          to_value: string | null
          updated_at: string
        }
        Insert: {
          approved_by?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          display_order?: number | null
          entity_id: string
          entity_type: string
          event_date: string
          event_date_precision?: string | null
          event_type: string
          from_entity_id?: string | null
          from_location_id?: string | null
          from_value?: string | null
          id?: string
          is_public?: boolean
          submission_id?: string | null
          title: string
          to_entity_id?: string | null
          to_location_id?: string | null
          to_value?: string | null
          updated_at?: string
        }
        Update: {
          approved_by?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          display_order?: number | null
          entity_id?: string
          entity_type?: string
          event_date?: string
          event_date_precision?: string | null
          event_type?: string
          from_entity_id?: string | null
          from_location_id?: string | null
          from_value?: string | null
          id?: string
          is_public?: boolean
          submission_id?: string | null
          title?: string
          to_entity_id?: string | null
          to_location_id?: string | null
          to_value?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "entity_timeline_events_from_location_id_fkey"
            columns: ["from_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "entity_timeline_events_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "entity_timeline_events_to_location_id_fkey"
            columns: ["to_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
        ]
      }
      entity_versions_archive: {
        Row: {
          change_reason: string | null
          change_type: Database["public"]["Enums"]["version_change_type"]
          changed_at: string
          changed_by: string | null
          entity_id: string
          entity_type: string
          id: string
          ip_address_hash: string | null
          is_current: boolean
          metadata: Json | null
          submission_id: string | null
          version_data: Json
          version_number: number
        }
        Insert: {
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          changed_at?: string
          changed_by?: string | null
          entity_id: string
          entity_type: string
          id?: string
          ip_address_hash?: string | null
          is_current?: boolean
          metadata?: Json | null
          submission_id?: string | null
          version_data: Json
          version_number: number
        }
        Update: {
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          changed_at?: string
          changed_by?: string | null
          entity_id?: string
          entity_type?: string
          id?: string
          ip_address_hash?: string | null
          is_current?: boolean
          metadata?: Json | null
          submission_id?: string | null
          version_data?: Json
          version_number?: number
        }
        Relationships: []
      }
      historical_parks: {
        Row: {
          closure_reason: string | null
          created_at: string
          final_state_data: Json
          id: string
          location_id: string | null
          name: string
          operated_from: string | null
          operated_from_precision: string | null
          operated_until: string | null
          operated_until_precision: string | null
          original_park_id: string | null
          slug: string
          successor_park_id: string | null
        }
        Insert: {
          closure_reason?: string | null
          created_at?: string
          final_state_data: Json
          id?: string
          location_id?: string | null
          name: string
          operated_from?: string | null
          operated_from_precision?: string | null
          operated_until?: string | null
          operated_until_precision?: string | null
          original_park_id?: string | null
          slug: string
          successor_park_id?: string | null
        }
        Update: {
          closure_reason?: string | null
          created_at?: string
          final_state_data?: Json
          id?: string
          location_id?: string | null
          name?: string
          operated_from?: string | null
          operated_from_precision?: string | null
          operated_until?: string | null
          operated_until_precision?: string | null
          original_park_id?: string | null
          slug?: string
          successor_park_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "historical_parks_location_id_fkey"
            columns: ["location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "historical_parks_original_park_id_fkey"
            columns: ["original_park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "historical_parks_successor_park_id_fkey"
            columns: ["successor_park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
        ]
      }
      historical_rides: {
        Row: {
          created_at: string
          final_state_data: Json
          id: string
          name: string
          operated_from: string | null
          operated_from_precision: string | null
          operated_until: string | null
          operated_until_precision: string | null
          original_ride_id: string | null
          park_id: string | null
          relocated_to_park_id: string | null
          removal_reason: string | null
          slug: string
          successor_ride_id: string | null
        }
        Insert: {
          created_at?: string
          final_state_data: Json
          id?: string
          name: string
          operated_from?: string | null
          operated_from_precision?: string | null
          operated_until?: string | null
          operated_until_precision?: string | null
          original_ride_id?: string | null
          park_id?: string | null
          relocated_to_park_id?: string | null
          removal_reason?: string | null
          slug: string
          successor_ride_id?: string | null
        }
        Update: {
          created_at?: string
          final_state_data?: Json
          id?: string
          name?: string
          operated_from?: string | null
          operated_from_precision?: string | null
          operated_until?: string | null
          operated_until_precision?: string | null
          original_ride_id?: string | null
          park_id?: string | null
          relocated_to_park_id?: string | null
          removal_reason?: string | null
          slug?: string
          successor_ride_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "historical_rides_original_ride_id_fkey"
            columns: ["original_ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "historical_rides_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "historical_rides_relocated_to_park_id_fkey"
            columns: ["relocated_to_park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "historical_rides_successor_ride_id_fkey"
            columns: ["successor_ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      item_edit_history: {
        Row: {
          changes: Json
          edited_at: string
          editor_id: string
          id: string
          item_id: string
        }
        Insert: {
          changes: Json
          edited_at?: string
          editor_id: string
          id?: string
          item_id: string
        }
        Update: {
          changes?: Json
          edited_at?: string
          editor_id?: string
          id?: string
          item_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "item_edit_history_item_id_fkey"
            columns: ["item_id"]
            isOneToOne: false
            referencedRelation: "submission_items"
            referencedColumns: ["id"]
          },
        ]
      }
      list_items: {
        Row: {
          created_at: string | null
          entity_id: string
          entity_type: string
          id: string
          list_id: string
          notes: string | null
          position: number
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          entity_id: string
          entity_type: string
          id?: string
          list_id: string
          notes?: string | null
          position: number
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          entity_id?: string
          entity_type?: string
          id?: string
          list_id?: string
          notes?: string | null
          position?: number
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "list_items_list_id_fkey"
            columns: ["list_id"]
            isOneToOne: false
            referencedRelation: "user_top_lists"
            referencedColumns: ["id"]
          },
        ]
      }
      locations: {
        Row: {
          city: string | null
          country: string
          created_at: string
          id: string
          latitude: number | null
          longitude: number | null
          name: string
          postal_code: string | null
          state_province: string | null
          timezone: string | null
        }
        Insert: {
          city?: string | null
          country: string
          created_at?: string
          id?: string
          latitude?: number | null
          longitude?: number | null
          name: string
          postal_code?: string | null
          state_province?: string | null
          timezone?: string | null
        }
        Update: {
          city?: string | null
          country?: string
          created_at?: string
          id?: string
          latitude?: number | null
          longitude?: number | null
          name?: string
          postal_code?: string | null
          state_province?: string | null
          timezone?: string | null
        }
        Relationships: []
      }
      moderation_audit_log: {
        Row: {
          action: string
          created_at: string
          id: string
          is_test_data: boolean | null
          metadata: Json | null
          moderator_id: string
          new_status: string | null
          notes: string | null
          previous_status: string | null
          submission_id: string | null
        }
        Insert: {
          action: string
          created_at?: string
          id?: string
          is_test_data?: boolean | null
          metadata?: Json | null
          moderator_id: string
          new_status?: string | null
          notes?: string | null
          previous_status?: string | null
          submission_id?: string | null
        }
        Update: {
          action?: string
          created_at?: string
          id?: string
          is_test_data?: boolean | null
          metadata?: Json | null
          moderator_id?: string
          new_status?: string | null
          notes?: string | null
          previous_status?: string | null
          submission_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "moderation_audit_log_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      notification_channels: {
        Row: {
          channel_type: string
          configuration: Json | null
          created_at: string
          description: string | null
          id: string
          is_enabled: boolean | null
          name: string
          updated_at: string
        }
        Insert: {
          channel_type: string
          configuration?: Json | null
          created_at?: string
          description?: string | null
          id?: string
          is_enabled?: boolean | null
          name: string
          updated_at?: string
        }
        Update: {
          channel_type?: string
          configuration?: Json | null
          created_at?: string
          description?: string | null
          id?: string
          is_enabled?: boolean | null
          name?: string
          updated_at?: string
        }
        Relationships: []
      }
      notification_duplicate_stats: {
        Row: {
          created_at: string | null
          date: string
          duplicates_prevented: number | null
          id: string
          prevention_rate: number | null
          total_attempts: number | null
        }
        Insert: {
          created_at?: string | null
          date?: string
          duplicates_prevented?: number | null
          id?: string
          prevention_rate?: number | null
          total_attempts?: number | null
        }
        Update: {
          created_at?: string | null
          date?: string
          duplicates_prevented?: number | null
          id?: string
          prevention_rate?: number | null
          total_attempts?: number | null
        }
        Relationships: []
      }
      notification_logs: {
        Row: {
          channel: string
          created_at: string
          delivered_at: string | null
          error_message: string | null
          id: string
          idempotency_key: string | null
          is_duplicate: boolean
          novu_transaction_id: string | null
          payload: Json | null
          read_at: string | null
          status: string
          template_id: string | null
          user_id: string
        }
        Insert: {
          channel: string
          created_at?: string
          delivered_at?: string | null
          error_message?: string | null
          id?: string
          idempotency_key?: string | null
          is_duplicate?: boolean
          novu_transaction_id?: string | null
          payload?: Json | null
          read_at?: string | null
          status?: string
          template_id?: string | null
          user_id: string
        }
        Update: {
          channel?: string
          created_at?: string
          delivered_at?: string | null
          error_message?: string | null
          id?: string
          idempotency_key?: string | null
          is_duplicate?: boolean
          novu_transaction_id?: string | null
          payload?: Json | null
          read_at?: string | null
          status?: string
          template_id?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "notification_logs_template_id_fkey"
            columns: ["template_id"]
            isOneToOne: false
            referencedRelation: "notification_templates"
            referencedColumns: ["id"]
          },
        ]
      }
      notification_templates: {
        Row: {
          category: string
          created_at: string
          description: string | null
          id: string
          is_active: boolean | null
          name: string
          novu_workflow_id: string | null
          updated_at: string
          workflow_id: string
        }
        Insert: {
          category: string
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean | null
          name: string
          novu_workflow_id?: string | null
          updated_at?: string
          workflow_id: string
        }
        Update: {
          category?: string
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean | null
          name?: string
          novu_workflow_id?: string | null
          updated_at?: string
          workflow_id?: string
        }
        Relationships: []
      }
      park_location_history: {
        Row: {
          created_at: string
          id: string
          moved_at: string
          new_location_id: string
          old_location_id: string | null
          park_id: string
          reason: string | null
        }
        Insert: {
          created_at?: string
          id?: string
          moved_at: string
          new_location_id: string
          old_location_id?: string | null
          park_id: string
          reason?: string | null
        }
        Update: {
          created_at?: string
          id?: string
          moved_at?: string
          new_location_id?: string
          old_location_id?: string | null
          park_id?: string
          reason?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "park_location_history_new_location_id_fkey"
            columns: ["new_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_location_history_old_location_id_fkey"
            columns: ["old_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_location_history_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
        ]
      }
      park_operating_hours: {
        Row: {
          closing_time: string | null
          created_at: string
          day_of_week: number
          id: string
          is_closed: boolean | null
          opening_time: string | null
          park_id: string
          season_end: string | null
          season_start: string | null
        }
        Insert: {
          closing_time?: string | null
          created_at?: string
          day_of_week: number
          id?: string
          is_closed?: boolean | null
          opening_time?: string | null
          park_id: string
          season_end?: string | null
          season_start?: string | null
        }
        Update: {
          closing_time?: string | null
          created_at?: string
          day_of_week?: number
          id?: string
          is_closed?: boolean | null
          opening_time?: string | null
          park_id?: string
          season_end?: string | null
          season_start?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "park_operating_hours_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
        ]
      }
      park_submissions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          closing_date: string | null
          closing_date_precision: string | null
          created_at: string
          description: string | null
          email: string | null
          id: string
          location_id: string | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          operator_id: string | null
          park_type: string
          phone: string | null
          property_owner_id: string | null
          slug: string
          status: string
          submission_id: string
          updated_at: string
          website_url: string | null
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          created_at?: string
          description?: string | null
          email?: string | null
          id?: string
          location_id?: string | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_type: string
          phone?: string | null
          property_owner_id?: string | null
          slug: string
          status?: string
          submission_id: string
          updated_at?: string
          website_url?: string | null
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          created_at?: string
          description?: string | null
          email?: string | null
          id?: string
          location_id?: string | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_type?: string
          phone?: string | null
          property_owner_id?: string | null
          slug?: string
          status?: string
          submission_id?: string
          updated_at?: string
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "park_submissions_location_id_fkey"
            columns: ["location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: true
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      park_versions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          change_reason: string | null
          change_type: Database["public"]["Enums"]["version_change_type"]
          closing_date: string | null
          closing_date_precision: string | null
          created_at: string
          created_by: string | null
          description: string | null
          email: string | null
          is_current: boolean
          is_test_data: boolean | null
          location_id: string | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          operator_id: string | null
          park_id: string
          park_type: string
          phone: string | null
          property_owner_id: string | null
          slug: string
          status: string
          submission_id: string | null
          version_id: string
          version_number: number
          website_url: string | null
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          closing_date?: string | null
          closing_date_precision?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          email?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          location_id?: string | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_id: string
          park_type: string
          phone?: string | null
          property_owner_id?: string | null
          slug: string
          status: string
          submission_id?: string | null
          version_id?: string
          version_number: number
          website_url?: string | null
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          closing_date?: string | null
          closing_date_precision?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          email?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          location_id?: string | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_id?: string
          park_type?: string
          phone?: string | null
          property_owner_id?: string | null
          slug?: string
          status?: string
          submission_id?: string | null
          version_id?: string
          version_number?: number
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "park_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "park_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "park_versions_location_id_fkey"
            columns: ["location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_versions_operator_id_fkey"
            columns: ["operator_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_versions_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_versions_property_owner_id_fkey"
            columns: ["property_owner_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "park_versions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      parks: {
        Row: {
          average_rating: number | null
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          closing_date: string | null
          closing_date_precision: string | null
          coaster_count: number | null
          created_at: string
          description: string | null
          email: string | null
          id: string
          is_test_data: boolean | null
          location_id: string | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          operator_id: string | null
          park_type: string
          phone: string | null
          property_owner_id: string | null
          review_count: number | null
          ride_count: number | null
          slug: string
          status: string
          updated_at: string
          view_count_30d: number | null
          view_count_7d: number | null
          view_count_all: number | null
          website_url: string | null
        }
        Insert: {
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_count?: number | null
          created_at?: string
          description?: string | null
          email?: string | null
          id?: string
          is_test_data?: boolean | null
          location_id?: string | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_type: string
          phone?: string | null
          property_owner_id?: string | null
          review_count?: number | null
          ride_count?: number | null
          slug: string
          status?: string
          updated_at?: string
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          website_url?: string | null
        }
        Update: {
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_count?: number | null
          created_at?: string
          description?: string | null
          email?: string | null
          id?: string
          is_test_data?: boolean | null
          location_id?: string | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          operator_id?: string | null
          park_type?: string
          phone?: string | null
          property_owner_id?: string | null
          review_count?: number | null
          ride_count?: number | null
          slug?: string
          status?: string
          updated_at?: string
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "parks_location_id_fkey"
            columns: ["location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "parks_operator_id_fkey"
            columns: ["operator_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "parks_property_owner_id_fkey"
            columns: ["property_owner_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
        ]
      }
      photo_submission_items: {
        Row: {
          caption: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at: string
          date_taken: string | null
          date_taken_precision: string | null
          file_size: number | null
          filename: string | null
          id: string
          mime_type: string | null
          order_index: number
          photo_submission_id: string
          title: string | null
        }
        Insert: {
          caption?: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at?: string
          date_taken?: string | null
          date_taken_precision?: string | null
          file_size?: number | null
          filename?: string | null
          id?: string
          mime_type?: string | null
          order_index?: number
          photo_submission_id: string
          title?: string | null
        }
        Update: {
          caption?: string | null
          cloudflare_image_id?: string
          cloudflare_image_url?: string
          created_at?: string
          date_taken?: string | null
          date_taken_precision?: string | null
          file_size?: number | null
          filename?: string | null
          id?: string
          mime_type?: string | null
          order_index?: number
          photo_submission_id?: string
          title?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "photo_submission_items_photo_submission_id_fkey"
            columns: ["photo_submission_id"]
            isOneToOne: false
            referencedRelation: "photo_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      photo_submissions: {
        Row: {
          created_at: string
          entity_id: string
          entity_type: string
          id: string
          parent_id: string | null
          submission_id: string
          title: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          entity_id: string
          entity_type: string
          id?: string
          parent_id?: string | null
          submission_id: string
          title?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          entity_id?: string
          entity_type?: string
          id?: string
          parent_id?: string | null
          submission_id?: string
          title?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "photo_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      photos: {
        Row: {
          approved_at: string | null
          approved_by: string | null
          caption: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at: string
          date_taken: string | null
          date_taken_precision: string | null
          entity_id: string
          entity_type: string
          id: string
          is_featured: boolean | null
          is_test_data: boolean | null
          order_index: number | null
          photographer_credit: string | null
          submission_id: string | null
          submitted_by: string | null
          title: string | null
          updated_at: string
        }
        Insert: {
          approved_at?: string | null
          approved_by?: string | null
          caption?: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at?: string
          date_taken?: string | null
          date_taken_precision?: string | null
          entity_id: string
          entity_type: string
          id?: string
          is_featured?: boolean | null
          is_test_data?: boolean | null
          order_index?: number | null
          photographer_credit?: string | null
          submission_id?: string | null
          submitted_by?: string | null
          title?: string | null
          updated_at?: string
        }
        Update: {
          approved_at?: string | null
          approved_by?: string | null
          caption?: string | null
          cloudflare_image_id?: string
          cloudflare_image_url?: string
          created_at?: string
          date_taken?: string | null
          date_taken_precision?: string | null
          entity_id?: string
          entity_type?: string
          id?: string
          is_featured?: boolean | null
          is_test_data?: boolean | null
          order_index?: number | null
          photographer_credit?: string | null
          submission_id?: string | null
          submitted_by?: string | null
          title?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      profile_audit_log: {
        Row: {
          action: string
          changed_by: string
          changes: Json
          created_at: string
          id: string
          ip_address_hash: string | null
          user_agent: string | null
          user_id: string
        }
        Insert: {
          action: string
          changed_by: string
          changes: Json
          created_at?: string
          id?: string
          ip_address_hash?: string | null
          user_agent?: string | null
          user_id: string
        }
        Update: {
          action?: string
          changed_by?: string
          changes?: Json
          created_at?: string
          id?: string
          ip_address_hash?: string | null
          user_agent?: string | null
          user_id?: string
        }
        Relationships: []
      }
      profiles: {
        Row: {
          auth0_sub: string | null
          avatar_image_id: string | null
          avatar_url: string | null
          ban_expires_at: string | null
          ban_reason: string | null
          banned: boolean
          bio: string | null
          coaster_count: number | null
          created_at: string
          date_of_birth: string | null
          deactivated: boolean
          deactivated_at: string | null
          deactivation_reason: string | null
          display_name: string | null
          home_park_id: string | null
          id: string
          location_id: string | null
          oauth_provider: string | null
          park_count: number | null
          personal_location: string | null
          preferred_language: string | null
          preferred_pronouns: string | null
          privacy_level: string
          reputation_score: number | null
          review_count: number | null
          ride_count: number | null
          show_pronouns: boolean | null
          theme_preference: string
          timezone: string | null
          updated_at: string
          user_id: string
          username: string
        }
        Insert: {
          auth0_sub?: string | null
          avatar_image_id?: string | null
          avatar_url?: string | null
          ban_expires_at?: string | null
          ban_reason?: string | null
          banned?: boolean
          bio?: string | null
          coaster_count?: number | null
          created_at?: string
          date_of_birth?: string | null
          deactivated?: boolean
          deactivated_at?: string | null
          deactivation_reason?: string | null
          display_name?: string | null
          home_park_id?: string | null
          id?: string
          location_id?: string | null
          oauth_provider?: string | null
          park_count?: number | null
          personal_location?: string | null
          preferred_language?: string | null
          preferred_pronouns?: string | null
          privacy_level?: string
          reputation_score?: number | null
          review_count?: number | null
          ride_count?: number | null
          show_pronouns?: boolean | null
          theme_preference?: string
          timezone?: string | null
          updated_at?: string
          user_id: string
          username: string
        }
        Update: {
          auth0_sub?: string | null
          avatar_image_id?: string | null
          avatar_url?: string | null
          ban_expires_at?: string | null
          ban_reason?: string | null
          banned?: boolean
          bio?: string | null
          coaster_count?: number | null
          created_at?: string
          date_of_birth?: string | null
          deactivated?: boolean
          deactivated_at?: string | null
          deactivation_reason?: string | null
          display_name?: string | null
          home_park_id?: string | null
          id?: string
          location_id?: string | null
          oauth_provider?: string | null
          park_count?: number | null
          personal_location?: string | null
          preferred_language?: string | null
          preferred_pronouns?: string | null
          privacy_level?: string
          reputation_score?: number | null
          review_count?: number | null
          ride_count?: number | null
          show_pronouns?: boolean | null
          theme_preference?: string
          timezone?: string | null
          updated_at?: string
          user_id?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "profiles_home_park_id_fkey"
            columns: ["home_park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "profiles_location_id_fkey"
            columns: ["location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
        ]
      }
      rate_limits: {
        Row: {
          action: string
          attempts: number
          created_at: string
          id: string
          user_id: string
          window_start: string
        }
        Insert: {
          action: string
          attempts?: number
          created_at?: string
          id?: string
          user_id: string
          window_start?: string
        }
        Update: {
          action?: string
          attempts?: number
          created_at?: string
          id?: string
          user_id?: string
          window_start?: string
        }
        Relationships: []
      }
      reports: {
        Row: {
          created_at: string
          id: string
          reason: string | null
          report_type: string
          reported_entity_id: string
          reported_entity_type: string
          reporter_id: string
          reviewed_at: string | null
          reviewed_by: string | null
          status: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          id?: string
          reason?: string | null
          report_type: string
          reported_entity_id: string
          reported_entity_type: string
          reporter_id: string
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          id?: string
          reason?: string | null
          report_type?: string
          reported_entity_id?: string
          reported_entity_type?: string
          reporter_id?: string
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: []
      }
      request_metadata: {
        Row: {
          client_version: string | null
          completed_at: string | null
          created_at: string
          duration_ms: number | null
          endpoint: string
          error_message: string | null
          error_type: string | null
          id: string
          ip_address_hash: string | null
          method: string
          parent_request_id: string | null
          request_id: string
          retry_count: number | null
          started_at: string
          status_code: number | null
          trace_id: string | null
          user_agent: string | null
          user_id: string | null
        }
        Insert: {
          client_version?: string | null
          completed_at?: string | null
          created_at?: string
          duration_ms?: number | null
          endpoint: string
          error_message?: string | null
          error_type?: string | null
          id?: string
          ip_address_hash?: string | null
          method: string
          parent_request_id?: string | null
          request_id: string
          retry_count?: number | null
          started_at?: string
          status_code?: number | null
          trace_id?: string | null
          user_agent?: string | null
          user_id?: string | null
        }
        Update: {
          client_version?: string | null
          completed_at?: string | null
          created_at?: string
          duration_ms?: number | null
          endpoint?: string
          error_message?: string | null
          error_type?: string | null
          id?: string
          ip_address_hash?: string | null
          method?: string
          parent_request_id?: string | null
          request_id?: string
          retry_count?: number | null
          started_at?: string
          status_code?: number | null
          trace_id?: string | null
          user_agent?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      review_deletions: {
        Row: {
          content: string | null
          created_at: string
          deleted_at: string | null
          deleted_by: string | null
          deletion_reason: string | null
          id: string
          park_id: string | null
          rating: number
          review_id: string
          ride_id: string | null
          user_id: string
          was_moderated: boolean | null
        }
        Insert: {
          content?: string | null
          created_at: string
          deleted_at?: string | null
          deleted_by?: string | null
          deletion_reason?: string | null
          id?: string
          park_id?: string | null
          rating: number
          review_id: string
          ride_id?: string | null
          user_id: string
          was_moderated?: boolean | null
        }
        Update: {
          content?: string | null
          created_at?: string
          deleted_at?: string | null
          deleted_by?: string | null
          deletion_reason?: string | null
          id?: string
          park_id?: string | null
          rating?: number
          review_id?: string
          ride_id?: string | null
          user_id?: string
          was_moderated?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "review_deletions_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "review_deletions_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      review_photos: {
        Row: {
          caption: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at: string
          id: string
          order_index: number
          review_id: string
        }
        Insert: {
          caption?: string | null
          cloudflare_image_id: string
          cloudflare_image_url: string
          created_at?: string
          id?: string
          order_index?: number
          review_id: string
        }
        Update: {
          caption?: string | null
          cloudflare_image_id?: string
          cloudflare_image_url?: string
          created_at?: string
          id?: string
          order_index?: number
          review_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "review_photos_review_id_fkey"
            columns: ["review_id"]
            isOneToOne: false
            referencedRelation: "reviews"
            referencedColumns: ["id"]
          },
        ]
      }
      reviews: {
        Row: {
          content: string | null
          created_at: string
          helpful_votes: number | null
          id: string
          is_test_data: boolean | null
          moderated_at: string | null
          moderated_by: string | null
          moderation_status: string
          park_id: string | null
          photos: Json | null
          rating: number
          report_count: number
          ride_id: string | null
          title: string | null
          total_votes: number | null
          updated_at: string
          user_id: string
          visit_date: string | null
          wait_time_minutes: number | null
        }
        Insert: {
          content?: string | null
          created_at?: string
          helpful_votes?: number | null
          id?: string
          is_test_data?: boolean | null
          moderated_at?: string | null
          moderated_by?: string | null
          moderation_status?: string
          park_id?: string | null
          photos?: Json | null
          rating: number
          report_count?: number
          ride_id?: string | null
          title?: string | null
          total_votes?: number | null
          updated_at?: string
          user_id: string
          visit_date?: string | null
          wait_time_minutes?: number | null
        }
        Update: {
          content?: string | null
          created_at?: string
          helpful_votes?: number | null
          id?: string
          is_test_data?: boolean | null
          moderated_at?: string | null
          moderated_by?: string | null
          moderation_status?: string
          park_id?: string | null
          photos?: Json | null
          rating?: number
          report_count?: number
          ride_id?: string | null
          title?: string | null
          total_votes?: number | null
          updated_at?: string
          user_id?: string
          visit_date?: string | null
          wait_time_minutes?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "reviews_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "reviews_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "reviews_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "reviews_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
        ]
      }
      ride_coaster_statistics: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          display_order: number | null
          id: string
          ride_id: string
          stat_name: string
          stat_value: number
          unit: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          ride_id: string
          stat_name: string
          stat_value: number
          unit?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          ride_id?: string
          stat_name?: string
          stat_value?: number
          unit?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_coaster_statistics_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_coaster_stats: {
        Row: {
          category: string | null
          created_at: string | null
          description: string | null
          display_order: number | null
          id: string
          ride_id: string
          stat_name: string
          stat_value: number
          unit: string | null
          updated_at: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          display_order?: number | null
          id?: string
          ride_id: string
          stat_name: string
          stat_value: number
          unit?: string | null
          updated_at?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          display_order?: number | null
          id?: string
          ride_id?: string
          stat_name?: string
          stat_value?: number
          unit?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_coaster_stats_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_dark_details: {
        Row: {
          animatronics_count: number | null
          created_at: string | null
          effects_type: string[] | null
          id: string
          interactive: boolean | null
          projection_type: string | null
          ride_id: string
          ride_system: string | null
          scenes_count: number | null
          show_duration_seconds: number | null
          story_description: string | null
          theme_name: string | null
          updated_at: string | null
        }
        Insert: {
          animatronics_count?: number | null
          created_at?: string | null
          effects_type?: string[] | null
          id?: string
          interactive?: boolean | null
          projection_type?: string | null
          ride_id: string
          ride_system?: string | null
          scenes_count?: number | null
          show_duration_seconds?: number | null
          story_description?: string | null
          theme_name?: string | null
          updated_at?: string | null
        }
        Update: {
          animatronics_count?: number | null
          created_at?: string | null
          effects_type?: string[] | null
          id?: string
          interactive?: boolean | null
          projection_type?: string | null
          ride_id?: string
          ride_system?: string | null
          scenes_count?: number | null
          show_duration_seconds?: number | null
          story_description?: string | null
          theme_name?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_dark_details_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: true
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_flat_details: {
        Row: {
          arm_length_meters: number | null
          created_at: string | null
          id: string
          max_height_reached_meters: number | null
          motion_pattern: string | null
          platform_count: number | null
          ride_id: string
          rotation_speed_rpm: number | null
          rotation_type: string | null
          spinning: boolean | null
          swing_angle_degrees: number | null
          updated_at: string | null
        }
        Insert: {
          arm_length_meters?: number | null
          created_at?: string | null
          id?: string
          max_height_reached_meters?: number | null
          motion_pattern?: string | null
          platform_count?: number | null
          ride_id: string
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          spinning?: boolean | null
          swing_angle_degrees?: number | null
          updated_at?: string | null
        }
        Update: {
          arm_length_meters?: number | null
          created_at?: string | null
          id?: string
          max_height_reached_meters?: number | null
          motion_pattern?: string | null
          platform_count?: number | null
          ride_id?: string
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          spinning?: boolean | null
          swing_angle_degrees?: number | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_flat_details_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: true
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_former_names: {
        Row: {
          created_at: string | null
          id: string
          name: string
          ride_id: string
          updated_at: string | null
          used_from: string | null
          used_until: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          name: string
          ride_id: string
          updated_at?: string | null
          used_from?: string | null
          used_until?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          name?: string
          ride_id?: string
          updated_at?: string | null
          used_from?: string | null
          used_until?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_former_names_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_kiddie_details: {
        Row: {
          character_theme: string | null
          created_at: string | null
          educational_theme: string | null
          gentle_mode: boolean | null
          id: string
          max_age: number | null
          min_age: number | null
          parent_supervision_required: boolean | null
          ride_id: string
          updated_at: string | null
        }
        Insert: {
          character_theme?: string | null
          created_at?: string | null
          educational_theme?: string | null
          gentle_mode?: boolean | null
          id?: string
          max_age?: number | null
          min_age?: number | null
          parent_supervision_required?: boolean | null
          ride_id: string
          updated_at?: string | null
        }
        Update: {
          character_theme?: string | null
          created_at?: string | null
          educational_theme?: string | null
          gentle_mode?: boolean | null
          id?: string
          max_age?: number | null
          min_age?: number | null
          parent_supervision_required?: boolean | null
          ride_id?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_kiddie_details_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: true
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_model_submissions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          created_at: string
          description: string | null
          id: string
          manufacturer_id: string | null
          name: string
          ride_type: string
          slug: string
          submission_id: string
          updated_at: string
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          created_at?: string
          description?: string | null
          id?: string
          manufacturer_id?: string | null
          name: string
          ride_type: string
          slug: string
          submission_id: string
          updated_at?: string
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          created_at?: string
          description?: string | null
          id?: string
          manufacturer_id?: string | null
          name?: string
          ride_type?: string
          slug?: string
          submission_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "ride_model_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: true
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_model_technical_specifications: {
        Row: {
          category: string | null
          created_at: string
          display_order: number | null
          id: string
          ride_model_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_model_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_model_id?: string
          spec_name?: string
          spec_type?: string
          spec_value?: string
          unit?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_model_technical_specifications_ride_model_id_fkey"
            columns: ["ride_model_id"]
            isOneToOne: false
            referencedRelation: "ride_models"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_model_versions: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          change_reason: string | null
          change_type: Database["public"]["Enums"]["version_change_type"]
          created_at: string
          created_by: string | null
          description: string | null
          is_current: boolean
          is_test_data: boolean | null
          manufacturer_id: string | null
          name: string
          ride_model_id: string
          ride_type: string | null
          slug: string
          submission_id: string | null
          version_id: string
          version_number: number
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          created_at?: string
          created_by?: string | null
          description?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          manufacturer_id?: string | null
          name: string
          ride_model_id: string
          ride_type?: string | null
          slug: string
          submission_id?: string | null
          version_id?: string
          version_number: number
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          created_at?: string
          created_by?: string | null
          description?: string | null
          is_current?: boolean
          is_test_data?: boolean | null
          manufacturer_id?: string | null
          name?: string
          ride_model_id?: string
          ride_type?: string | null
          slug?: string
          submission_id?: string | null
          version_id?: string
          version_number?: number
        }
        Relationships: [
          {
            foreignKeyName: "ride_model_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "ride_model_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "ride_model_versions_manufacturer_id_fkey"
            columns: ["manufacturer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_model_versions_ride_model_id_fkey"
            columns: ["ride_model_id"]
            isOneToOne: false
            referencedRelation: "ride_models"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_model_versions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_models: {
        Row: {
          banner_image_id: string | null
          banner_image_url: string | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          created_at: string
          description: string | null
          id: string
          is_test_data: boolean | null
          manufacturer_id: string
          name: string
          ride_type: string
          slug: string
          updated_at: string
        }
        Insert: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          created_at?: string
          description?: string | null
          id?: string
          is_test_data?: boolean | null
          manufacturer_id: string
          name: string
          ride_type: string
          slug: string
          updated_at?: string
        }
        Update: {
          banner_image_id?: string | null
          banner_image_url?: string | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          created_at?: string
          description?: string | null
          id?: string
          is_test_data?: boolean | null
          manufacturer_id?: string
          name?: string
          ride_type?: string
          slug?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "ride_models_manufacturer_id_fkey"
            columns: ["manufacturer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_name_history: {
        Row: {
          created_at: string
          date_changed: string | null
          date_changed_precision: string | null
          former_name: string
          from_year: number | null
          id: string
          order_index: number | null
          reason: string | null
          ride_id: string
          to_year: number | null
        }
        Insert: {
          created_at?: string
          date_changed?: string | null
          date_changed_precision?: string | null
          former_name: string
          from_year?: number | null
          id?: string
          order_index?: number | null
          reason?: string | null
          ride_id: string
          to_year?: number | null
        }
        Update: {
          created_at?: string
          date_changed?: string | null
          date_changed_precision?: string | null
          former_name?: string
          from_year?: number | null
          id?: string
          order_index?: number | null
          reason?: string | null
          ride_id?: string
          to_year?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_name_history_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_submission_coaster_statistics: {
        Row: {
          category: string | null
          created_at: string
          id: string
          ride_submission_id: string
          stat_name: string
          stat_value: number
          unit: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string
          id?: string
          ride_submission_id: string
          stat_name: string
          stat_value: number
          unit?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string
          id?: string
          ride_submission_id?: string
          stat_name?: string
          stat_value?: number
          unit?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "fk_ride_submission_coaster_statistics_ride_submission_id"
            columns: ["ride_submission_id"]
            isOneToOne: false
            referencedRelation: "ride_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_submission_name_history: {
        Row: {
          created_at: string
          date_changed: string | null
          date_changed_precision: string | null
          former_name: string
          id: string
          order_index: number | null
          reason: string | null
          ride_submission_id: string
        }
        Insert: {
          created_at?: string
          date_changed?: string | null
          date_changed_precision?: string | null
          former_name: string
          id?: string
          order_index?: number | null
          reason?: string | null
          ride_submission_id: string
        }
        Update: {
          created_at?: string
          date_changed?: string | null
          date_changed_precision?: string | null
          former_name?: string
          id?: string
          order_index?: number | null
          reason?: string | null
          ride_submission_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "fk_ride_submission_name_history_ride_submission_id"
            columns: ["ride_submission_id"]
            isOneToOne: false
            referencedRelation: "ride_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_submission_technical_specifications: {
        Row: {
          category: string | null
          created_at: string
          display_order: number | null
          id: string
          ride_submission_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_submission_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_submission_id?: string
          spec_name?: string
          spec_type?: string
          spec_value?: string
          unit?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "fk_ride_submission_technical_specifications_ride_submission_id"
            columns: ["ride_submission_id"]
            isOneToOne: false
            referencedRelation: "ride_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_submissions: {
        Row: {
          age_requirement: number | null
          banner_image_id: string | null
          banner_image_url: string | null
          capacity_per_hour: number | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          closing_date: string | null
          closing_date_precision: string | null
          coaster_type: string | null
          created_at: string
          description: string | null
          designer_id: string | null
          drop_height_meters: number | null
          duration_seconds: number | null
          height_requirement: number | null
          id: string
          image_url: string | null
          intensity_level: string | null
          inversions: number | null
          length_meters: number | null
          manufacturer_id: string | null
          max_g_force: number | null
          max_height_meters: number | null
          max_speed_kmh: number | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          park_id: string | null
          propulsion_method: string[] | null
          ride_model_id: string | null
          ride_sub_type: string | null
          seating_type: string | null
          slug: string
          status: string
          submission_id: string
          support_material: string[] | null
          track_material: string[] | null
          updated_at: string
        }
        Insert: {
          age_requirement?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          description?: string | null
          designer_id?: string | null
          drop_height_meters?: number | null
          duration_seconds?: number | null
          height_requirement?: number | null
          id?: string
          image_url?: string | null
          intensity_level?: string | null
          inversions?: number | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_g_force?: number | null
          max_height_meters?: number | null
          max_speed_kmh?: number | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id?: string | null
          propulsion_method?: string[] | null
          ride_model_id?: string | null
          ride_sub_type?: string | null
          seating_type?: string | null
          slug: string
          status?: string
          submission_id: string
          support_material?: string[] | null
          track_material?: string[] | null
          updated_at?: string
        }
        Update: {
          age_requirement?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          description?: string | null
          designer_id?: string | null
          drop_height_meters?: number | null
          duration_seconds?: number | null
          height_requirement?: number | null
          id?: string
          image_url?: string | null
          intensity_level?: string | null
          inversions?: number | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_g_force?: number | null
          max_height_meters?: number | null
          max_speed_kmh?: number | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id?: string | null
          propulsion_method?: string[] | null
          ride_model_id?: string | null
          ride_sub_type?: string | null
          seating_type?: string | null
          slug?: string
          status?: string
          submission_id?: string
          support_material?: string[] | null
          track_material?: string[] | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "ride_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: true
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_technical_specifications: {
        Row: {
          category: string | null
          created_at: string
          display_order: number | null
          id: string
          ride_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_id: string
          spec_name: string
          spec_type: string
          spec_value: string
          unit?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          ride_id?: string
          spec_name?: string
          spec_type?: string
          spec_value?: string
          unit?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_technical_specifications_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_transportation_details: {
        Row: {
          accessibility_features: string[] | null
          created_at: string | null
          id: string
          ride_id: string
          round_trip_duration_seconds: number | null
          route_length_meters: number | null
          stations_count: number | null
          transport_type: string | null
          updated_at: string | null
          vehicle_capacity: number | null
          vehicles_count: number | null
        }
        Insert: {
          accessibility_features?: string[] | null
          created_at?: string | null
          id?: string
          ride_id: string
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          stations_count?: number | null
          transport_type?: string | null
          updated_at?: string | null
          vehicle_capacity?: number | null
          vehicles_count?: number | null
        }
        Update: {
          accessibility_features?: string[] | null
          created_at?: string | null
          id?: string
          ride_id?: string
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          stations_count?: number | null
          transport_type?: string | null
          updated_at?: string | null
          vehicle_capacity?: number | null
          vehicles_count?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_transportation_details_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: true
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_versions: {
        Row: {
          age_requirement: number | null
          animatronics_count: number | null
          arm_length_meters: number | null
          banner_image_id: string | null
          banner_image_url: string | null
          boat_capacity: number | null
          capacity_per_hour: number | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          change_reason: string | null
          change_type: Database["public"]["Enums"]["version_change_type"]
          character_theme: string | null
          closing_date: string | null
          closing_date_precision: string | null
          coaster_type: string | null
          created_at: string
          created_by: string | null
          description: string | null
          designer_id: string | null
          drop_meters: number | null
          duration_seconds: number | null
          educational_theme: string | null
          flume_type: string | null
          gforce_max: number | null
          height_meters: number | null
          height_requirement_cm: number | null
          image_url: string | null
          intensity_level: string | null
          inversions_count: number | null
          is_current: boolean
          is_test_data: boolean | null
          length_meters: number | null
          manufacturer_id: string | null
          max_age: number | null
          max_height_reached_meters: number | null
          max_speed_kmh: number | null
          min_age: number | null
          motion_pattern: string | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          park_id: string | null
          platform_count: number | null
          projection_type: string | null
          propulsion_method: string[] | null
          ride_id: string
          ride_model_id: string | null
          ride_sub_type: string | null
          ride_system: string | null
          rotation_speed_rpm: number | null
          rotation_type: string | null
          round_trip_duration_seconds: number | null
          route_length_meters: number | null
          scenes_count: number | null
          seating_type: string | null
          show_duration_seconds: number | null
          slug: string
          splash_height_meters: number | null
          stations_count: number | null
          status: string
          story_description: string | null
          submission_id: string | null
          support_material: string[] | null
          swing_angle_degrees: number | null
          theme_name: string | null
          track_material: string[] | null
          transport_type: string | null
          vehicle_capacity: number | null
          vehicles_count: number | null
          version_id: string
          version_number: number
          water_depth_cm: number | null
          wetness_level: string | null
        }
        Insert: {
          age_requirement?: number | null
          animatronics_count?: number | null
          arm_length_meters?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          boat_capacity?: number | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          character_theme?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          designer_id?: string | null
          drop_meters?: number | null
          duration_seconds?: number | null
          educational_theme?: string | null
          flume_type?: string | null
          gforce_max?: number | null
          height_meters?: number | null
          height_requirement_cm?: number | null
          image_url?: string | null
          intensity_level?: string | null
          inversions_count?: number | null
          is_current?: boolean
          is_test_data?: boolean | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_age?: number | null
          max_height_reached_meters?: number | null
          max_speed_kmh?: number | null
          min_age?: number | null
          motion_pattern?: string | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id?: string | null
          platform_count?: number | null
          projection_type?: string | null
          propulsion_method?: string[] | null
          ride_id: string
          ride_model_id?: string | null
          ride_sub_type?: string | null
          ride_system?: string | null
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          scenes_count?: number | null
          seating_type?: string | null
          show_duration_seconds?: number | null
          slug: string
          splash_height_meters?: number | null
          stations_count?: number | null
          status: string
          story_description?: string | null
          submission_id?: string | null
          support_material?: string[] | null
          swing_angle_degrees?: number | null
          theme_name?: string | null
          track_material?: string[] | null
          transport_type?: string | null
          vehicle_capacity?: number | null
          vehicles_count?: number | null
          version_id?: string
          version_number: number
          water_depth_cm?: number | null
          wetness_level?: string | null
        }
        Update: {
          age_requirement?: number | null
          animatronics_count?: number | null
          arm_length_meters?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          boat_capacity?: number | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          change_reason?: string | null
          change_type?: Database["public"]["Enums"]["version_change_type"]
          character_theme?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          designer_id?: string | null
          drop_meters?: number | null
          duration_seconds?: number | null
          educational_theme?: string | null
          flume_type?: string | null
          gforce_max?: number | null
          height_meters?: number | null
          height_requirement_cm?: number | null
          image_url?: string | null
          intensity_level?: string | null
          inversions_count?: number | null
          is_current?: boolean
          is_test_data?: boolean | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_age?: number | null
          max_height_reached_meters?: number | null
          max_speed_kmh?: number | null
          min_age?: number | null
          motion_pattern?: string | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id?: string | null
          platform_count?: number | null
          projection_type?: string | null
          propulsion_method?: string[] | null
          ride_id?: string
          ride_model_id?: string | null
          ride_sub_type?: string | null
          ride_system?: string | null
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          scenes_count?: number | null
          seating_type?: string | null
          show_duration_seconds?: number | null
          slug?: string
          splash_height_meters?: number | null
          stations_count?: number | null
          status?: string
          story_description?: string | null
          submission_id?: string | null
          support_material?: string[] | null
          swing_angle_degrees?: number | null
          theme_name?: string | null
          track_material?: string[] | null
          transport_type?: string | null
          vehicle_capacity?: number | null
          vehicles_count?: number | null
          version_id?: string
          version_number?: number
          water_depth_cm?: number | null
          wetness_level?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "filtered_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "ride_versions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "ride_versions_designer_id_fkey"
            columns: ["designer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_versions_manufacturer_id_fkey"
            columns: ["manufacturer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_versions_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_versions_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ride_versions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      ride_water_details: {
        Row: {
          boat_capacity: number | null
          created_at: string | null
          flume_type: string | null
          id: string
          pump_capacity_lph: number | null
          ride_id: string
          splash_height_meters: number | null
          updated_at: string | null
          water_depth_cm: number | null
          water_volume_liters: number | null
          wetness_level: string | null
        }
        Insert: {
          boat_capacity?: number | null
          created_at?: string | null
          flume_type?: string | null
          id?: string
          pump_capacity_lph?: number | null
          ride_id: string
          splash_height_meters?: number | null
          updated_at?: string | null
          water_depth_cm?: number | null
          water_volume_liters?: number | null
          wetness_level?: string | null
        }
        Update: {
          boat_capacity?: number | null
          created_at?: string | null
          flume_type?: string | null
          id?: string
          pump_capacity_lph?: number | null
          ride_id?: string
          splash_height_meters?: number | null
          updated_at?: string | null
          water_depth_cm?: number | null
          water_volume_liters?: number | null
          wetness_level?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ride_water_details_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: true
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      rides: {
        Row: {
          age_requirement: number | null
          animatronics_count: number | null
          arm_length_meters: number | null
          average_rating: number | null
          banner_image_id: string | null
          banner_image_url: string | null
          boat_capacity: number | null
          capacity_per_hour: number | null
          card_image_id: string | null
          card_image_url: string | null
          category: string
          character_theme: string | null
          closing_date: string | null
          closing_date_precision: string | null
          coaster_type: string | null
          created_at: string
          description: string | null
          designer_id: string | null
          drop_height_meters: number | null
          duration_seconds: number | null
          educational_theme: string | null
          flume_type: string | null
          height_requirement: number | null
          id: string
          image_url: string | null
          intensity_level: string | null
          inversions: number | null
          is_test_data: boolean | null
          length_meters: number | null
          manufacturer_id: string | null
          max_age: number | null
          max_g_force: number | null
          max_height_meters: number | null
          max_height_reached_meters: number | null
          max_speed_kmh: number | null
          min_age: number | null
          motion_pattern: string | null
          name: string
          opening_date: string | null
          opening_date_precision: string | null
          park_id: string
          platform_count: number | null
          projection_type: string | null
          propulsion_method: string[] | null
          review_count: number | null
          ride_model_id: string | null
          ride_sub_type: string | null
          ride_system: string | null
          rotation_speed_rpm: number | null
          rotation_type: string | null
          round_trip_duration_seconds: number | null
          route_length_meters: number | null
          scenes_count: number | null
          seating_type: string | null
          show_duration_seconds: number | null
          slug: string
          splash_height_meters: number | null
          stations_count: number | null
          status: string
          story_description: string | null
          support_material: string[] | null
          swing_angle_degrees: number | null
          theme_name: string | null
          track_material: string[] | null
          transport_type: string | null
          updated_at: string
          vehicle_capacity: number | null
          vehicles_count: number | null
          view_count_30d: number | null
          view_count_7d: number | null
          view_count_all: number | null
          water_depth_cm: number | null
          wetness_level: string | null
        }
        Insert: {
          age_requirement?: number | null
          animatronics_count?: number | null
          arm_length_meters?: number | null
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          boat_capacity?: number | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category: string
          character_theme?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          description?: string | null
          designer_id?: string | null
          drop_height_meters?: number | null
          duration_seconds?: number | null
          educational_theme?: string | null
          flume_type?: string | null
          height_requirement?: number | null
          id?: string
          image_url?: string | null
          intensity_level?: string | null
          inversions?: number | null
          is_test_data?: boolean | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_age?: number | null
          max_g_force?: number | null
          max_height_meters?: number | null
          max_height_reached_meters?: number | null
          max_speed_kmh?: number | null
          min_age?: number | null
          motion_pattern?: string | null
          name: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id: string
          platform_count?: number | null
          projection_type?: string | null
          propulsion_method?: string[] | null
          review_count?: number | null
          ride_model_id?: string | null
          ride_sub_type?: string | null
          ride_system?: string | null
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          scenes_count?: number | null
          seating_type?: string | null
          show_duration_seconds?: number | null
          slug: string
          splash_height_meters?: number | null
          stations_count?: number | null
          status?: string
          story_description?: string | null
          support_material?: string[] | null
          swing_angle_degrees?: number | null
          theme_name?: string | null
          track_material?: string[] | null
          transport_type?: string | null
          updated_at?: string
          vehicle_capacity?: number | null
          vehicles_count?: number | null
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          water_depth_cm?: number | null
          wetness_level?: string | null
        }
        Update: {
          age_requirement?: number | null
          animatronics_count?: number | null
          arm_length_meters?: number | null
          average_rating?: number | null
          banner_image_id?: string | null
          banner_image_url?: string | null
          boat_capacity?: number | null
          capacity_per_hour?: number | null
          card_image_id?: string | null
          card_image_url?: string | null
          category?: string
          character_theme?: string | null
          closing_date?: string | null
          closing_date_precision?: string | null
          coaster_type?: string | null
          created_at?: string
          description?: string | null
          designer_id?: string | null
          drop_height_meters?: number | null
          duration_seconds?: number | null
          educational_theme?: string | null
          flume_type?: string | null
          height_requirement?: number | null
          id?: string
          image_url?: string | null
          intensity_level?: string | null
          inversions?: number | null
          is_test_data?: boolean | null
          length_meters?: number | null
          manufacturer_id?: string | null
          max_age?: number | null
          max_g_force?: number | null
          max_height_meters?: number | null
          max_height_reached_meters?: number | null
          max_speed_kmh?: number | null
          min_age?: number | null
          motion_pattern?: string | null
          name?: string
          opening_date?: string | null
          opening_date_precision?: string | null
          park_id?: string
          platform_count?: number | null
          projection_type?: string | null
          propulsion_method?: string[] | null
          review_count?: number | null
          ride_model_id?: string | null
          ride_sub_type?: string | null
          ride_system?: string | null
          rotation_speed_rpm?: number | null
          rotation_type?: string | null
          round_trip_duration_seconds?: number | null
          route_length_meters?: number | null
          scenes_count?: number | null
          seating_type?: string | null
          show_duration_seconds?: number | null
          slug?: string
          splash_height_meters?: number | null
          stations_count?: number | null
          status?: string
          story_description?: string | null
          support_material?: string[] | null
          swing_angle_degrees?: number | null
          theme_name?: string | null
          track_material?: string[] | null
          transport_type?: string | null
          updated_at?: string
          vehicle_capacity?: number | null
          vehicles_count?: number | null
          view_count_30d?: number | null
          view_count_7d?: number | null
          view_count_all?: number | null
          water_depth_cm?: number | null
          wetness_level?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "rides_designer_id_fkey"
            columns: ["designer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rides_manufacturer_id_fkey"
            columns: ["manufacturer_id"]
            isOneToOne: false
            referencedRelation: "companies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rides_park_id_fkey"
            columns: ["park_id"]
            isOneToOne: false
            referencedRelation: "parks"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rides_ride_model_id_fkey"
            columns: ["ride_model_id"]
            isOneToOne: false
            referencedRelation: "ride_models"
            referencedColumns: ["id"]
          },
        ]
      }
      submission_dependencies: {
        Row: {
          child_entity_type: string
          child_submission_id: string
          created_at: string
          dependency_type: string
          id: string
          parent_entity_type: string
          parent_submission_id: string
        }
        Insert: {
          child_entity_type: string
          child_submission_id: string
          created_at?: string
          dependency_type?: string
          id?: string
          parent_entity_type: string
          parent_submission_id: string
        }
        Update: {
          child_entity_type?: string
          child_submission_id?: string
          created_at?: string
          dependency_type?: string
          id?: string
          parent_entity_type?: string
          parent_submission_id?: string
        }
        Relationships: []
      }
      submission_items: {
        Row: {
          action_type: string | null
          approved_entity_id: string | null
          created_at: string
          depends_on: string | null
          id: string
          is_test_data: boolean | null
          item_data_id: string | null
          item_type: string
          order_index: number | null
          rejection_reason: string | null
          status: string
          submission_id: string
          updated_at: string
        }
        Insert: {
          action_type?: string | null
          approved_entity_id?: string | null
          created_at?: string
          depends_on?: string | null
          id?: string
          is_test_data?: boolean | null
          item_data_id?: string | null
          item_type: string
          order_index?: number | null
          rejection_reason?: string | null
          status?: string
          submission_id: string
          updated_at?: string
        }
        Update: {
          action_type?: string | null
          approved_entity_id?: string | null
          created_at?: string
          depends_on?: string | null
          id?: string
          is_test_data?: boolean | null
          item_data_id?: string | null
          item_type?: string
          order_index?: number | null
          rejection_reason?: string | null
          status?: string
          submission_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "submission_items_depends_on_fkey"
            columns: ["depends_on"]
            isOneToOne: false
            referencedRelation: "submission_items"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "submission_items_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
        ]
      }
      test_data_registry: {
        Row: {
          created_at: string
          entity_id: string
          entity_slug: string
          entity_type: string
          id: string
          is_test_data: boolean | null
          metadata: Json | null
          submission_item_id: string | null
          test_session_id: string | null
        }
        Insert: {
          created_at?: string
          entity_id: string
          entity_slug: string
          entity_type: string
          id?: string
          is_test_data?: boolean | null
          metadata?: Json | null
          submission_item_id?: string | null
          test_session_id?: string | null
        }
        Update: {
          created_at?: string
          entity_id?: string
          entity_slug?: string
          entity_type?: string
          id?: string
          is_test_data?: boolean | null
          metadata?: Json | null
          submission_item_id?: string | null
          test_session_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "test_data_registry_submission_item_id_fkey"
            columns: ["submission_item_id"]
            isOneToOne: false
            referencedRelation: "submission_items"
            referencedColumns: ["id"]
          },
        ]
      }
      timeline_event_submissions: {
        Row: {
          created_at: string
          description: string | null
          display_order: number | null
          entity_id: string
          entity_type: string
          event_date: string
          event_date_precision: string
          event_type: string
          from_entity_id: string | null
          from_location_id: string | null
          from_value: string | null
          id: string
          is_public: boolean | null
          submission_id: string
          title: string
          to_entity_id: string | null
          to_location_id: string | null
          to_value: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          display_order?: number | null
          entity_id: string
          entity_type: string
          event_date: string
          event_date_precision: string
          event_type: string
          from_entity_id?: string | null
          from_location_id?: string | null
          from_value?: string | null
          id?: string
          is_public?: boolean | null
          submission_id: string
          title: string
          to_entity_id?: string | null
          to_location_id?: string | null
          to_value?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          description?: string | null
          display_order?: number | null
          entity_id?: string
          entity_type?: string
          event_date?: string
          event_date_precision?: string
          event_type?: string
          from_entity_id?: string | null
          from_location_id?: string | null
          from_value?: string | null
          id?: string
          is_public?: boolean | null
          submission_id?: string
          title?: string
          to_entity_id?: string | null
          to_location_id?: string | null
          to_value?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "timeline_event_submissions_from_location_id_fkey"
            columns: ["from_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "timeline_event_submissions_submission_id_fkey"
            columns: ["submission_id"]
            isOneToOne: false
            referencedRelation: "content_submissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "timeline_event_submissions_to_location_id_fkey"
            columns: ["to_location_id"]
            isOneToOne: false
            referencedRelation: "locations"
            referencedColumns: ["id"]
          },
        ]
      }
      user_blocks: {
        Row: {
          blocked_id: string
          blocker_id: string
          created_at: string
          id: string
          reason: string | null
        }
        Insert: {
          blocked_id: string
          blocker_id: string
          created_at?: string
          id?: string
          reason?: string | null
        }
        Update: {
          blocked_id?: string
          blocker_id?: string
          created_at?: string
          id?: string
          reason?: string | null
        }
        Relationships: []
      }
      user_notification_preferences: {
        Row: {
          channel_preferences: Json
          created_at: string
          frequency_settings: Json
          id: string
          novu_subscriber_id: string | null
          updated_at: string
          user_id: string
          workflow_preferences: Json
        }
        Insert: {
          channel_preferences?: Json
          created_at?: string
          frequency_settings?: Json
          id?: string
          novu_subscriber_id?: string | null
          updated_at?: string
          user_id: string
          workflow_preferences?: Json
        }
        Update: {
          channel_preferences?: Json
          created_at?: string
          frequency_settings?: Json
          id?: string
          novu_subscriber_id?: string | null
          updated_at?: string
          user_id?: string
          workflow_preferences?: Json
        }
        Relationships: []
      }
      user_preferences: {
        Row: {
          accessibility_options: Json
          auto_save_enabled: boolean | null
          created_at: string
          email_notifications: Json
          id: string
          privacy_settings: Json
          push_notifications: Json
          unit_preferences: Json
          updated_at: string
          user_id: string
        }
        Insert: {
          accessibility_options?: Json
          auto_save_enabled?: boolean | null
          created_at?: string
          email_notifications?: Json
          id?: string
          privacy_settings?: Json
          push_notifications?: Json
          unit_preferences?: Json
          updated_at?: string
          user_id: string
        }
        Update: {
          accessibility_options?: Json
          auto_save_enabled?: boolean | null
          created_at?: string
          email_notifications?: Json
          id?: string
          privacy_settings?: Json
          push_notifications?: Json
          unit_preferences?: Json
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
      user_ride_credits: {
        Row: {
          created_at: string
          first_ride_date: string | null
          id: string
          last_ride_date: string | null
          personal_notes: string | null
          personal_photo_id: string | null
          personal_rating: number | null
          ride_count: number | null
          ride_id: string
          sort_order: number | null
          updated_at: string
          user_id: string
        }
        Insert: {
          created_at?: string
          first_ride_date?: string | null
          id?: string
          last_ride_date?: string | null
          personal_notes?: string | null
          personal_photo_id?: string | null
          personal_rating?: number | null
          ride_count?: number | null
          ride_id: string
          sort_order?: number | null
          updated_at?: string
          user_id: string
        }
        Update: {
          created_at?: string
          first_ride_date?: string | null
          id?: string
          last_ride_date?: string | null
          personal_notes?: string | null
          personal_photo_id?: string | null
          personal_rating?: number | null
          ride_count?: number | null
          ride_id?: string
          sort_order?: number | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_ride_credits_ride_id_fkey"
            columns: ["ride_id"]
            isOneToOne: false
            referencedRelation: "rides"
            referencedColumns: ["id"]
          },
        ]
      }
      user_roles: {
        Row: {
          created_at: string
          granted_at: string
          granted_by: string | null
          id: string
          role: Database["public"]["Enums"]["app_role"]
          user_id: string
        }
        Insert: {
          created_at?: string
          granted_at?: string
          granted_by?: string | null
          id?: string
          role: Database["public"]["Enums"]["app_role"]
          user_id: string
        }
        Update: {
          created_at?: string
          granted_at?: string
          granted_by?: string | null
          id?: string
          role?: Database["public"]["Enums"]["app_role"]
          user_id?: string
        }
        Relationships: []
      }
      user_top_list_items: {
        Row: {
          created_at: string
          entity_id: string
          entity_type: string
          id: string
          list_id: string
          notes: string | null
          position: number
          updated_at: string
        }
        Insert: {
          created_at?: string
          entity_id: string
          entity_type: string
          id?: string
          list_id: string
          notes?: string | null
          position: number
          updated_at?: string
        }
        Update: {
          created_at?: string
          entity_id?: string
          entity_type?: string
          id?: string
          list_id?: string
          notes?: string | null
          position?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_top_list_items_list_id_fkey"
            columns: ["list_id"]
            isOneToOne: false
            referencedRelation: "user_top_lists"
            referencedColumns: ["id"]
          },
        ]
      }
      user_top_lists: {
        Row: {
          created_at: string
          description: string | null
          id: string
          is_public: boolean | null
          list_type: string
          title: string
          updated_at: string
          user_id: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          is_public?: boolean | null
          list_type: string
          title: string
          updated_at?: string
          user_id: string
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          is_public?: boolean | null
          list_type?: string
          title?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: []
      }
    }
    Views: {
      filtered_profiles: {
        Row: {
          avatar_image_id: string | null
          avatar_url: string | null
          banned: boolean | null
          bio: string | null
          coaster_count: number | null
          created_at: string | null
          date_of_birth: string | null
          display_name: string | null
          home_park_id: string | null
          id: string | null
          location_id: string | null
          park_count: number | null
          personal_location: string | null
          preferred_language: string | null
          preferred_pronouns: string | null
          privacy_level: string | null
          reputation_score: number | null
          review_count: number | null
          ride_count: number | null
          show_pronouns: boolean | null
          theme_preference: string | null
          timezone: string | null
          updated_at: string | null
          user_id: string | null
          username: string | null
        }
        Insert: {
          avatar_image_id?: never
          avatar_url?: never
          banned?: never
          bio?: never
          coaster_count?: never
          created_at?: string | null
          date_of_birth?: never
          display_name?: string | null
          home_park_id?: never
          id?: string | null
          location_id?: never
          park_count?: never
          personal_location?: never
          preferred_language?: string | null
          preferred_pronouns?: never
          privacy_level?: string | null
          reputation_score?: never
          review_count?: never
          ride_count?: never
          show_pronouns?: never
          theme_preference?: string | null
          timezone?: string | null
          updated_at?: string | null
          user_id?: string | null
          username?: string | null
        }
        Update: {
          avatar_image_id?: never
          avatar_url?: never
          banned?: never
          bio?: never
          coaster_count?: never
          created_at?: string | null
          date_of_birth?: never
          display_name?: string | null
          home_park_id?: never
          id?: string | null
          location_id?: never
          park_count?: never
          personal_location?: never
          preferred_language?: string | null
          preferred_pronouns?: never
          privacy_level?: string | null
          reputation_score?: never
          review_count?: never
          ride_count?: never
          show_pronouns?: never
          theme_preference?: string | null
          timezone?: string | null
          updated_at?: string | null
          user_id?: string | null
          username?: string | null
        }
        Relationships: []
      }
      moderation_sla_metrics: {
        Row: {
          avg_resolution_hours: number | null
          avg_wait_hours: number | null
          currently_locked: number | null
          escalated_count: number | null
          max_wait_hours: number | null
          pending_count: number | null
          reassigned_count: number | null
          submission_type: string | null
        }
        Relationships: []
      }
      notification_health_dashboard: {
        Row: {
          date: string | null
          duplicates_prevented: number | null
          health_status: string | null
          prevention_rate: number | null
          total_attempts: number | null
        }
        Relationships: []
      }
    }
    Functions: {
      anonymize_user_submissions: {
        Args: { target_user_id: string }
        Returns: undefined
      }
      backfill_sort_orders: { Args: never; Returns: undefined }
      block_aal1_with_mfa: { Args: never; Returns: boolean }
      can_approve_submission_item: {
        Args: { item_id: string }
        Returns: boolean
      }
      can_manage_deletion: {
        Args: { _deletion_id: string; _user_id: string }
        Returns: boolean
      }
      can_manage_user: {
        Args: { _manager_id: string; _target_user_id: string }
        Returns: boolean
      }
      can_view_profile_field: {
        Args: {
          _field_name: string
          _profile_user_id: string
          _viewer_id: string
        }
        Returns: boolean
      }
      can_view_user_location: {
        Args: { _profile_user_id: string; _viewer_id: string }
        Returns: boolean
      }
      cancel_user_email_change: { Args: { _user_id: string }; Returns: boolean }
      check_rate_limit: {
        Args: {
          p_action: string
          p_max_attempts: number
          p_window_minutes: number
        }
        Returns: Json
      }
      check_realtime_access: { Args: never; Returns: boolean }
      claim_next_submission: {
        Args: { lock_duration?: unknown; moderator_id: string }
        Returns: {
          submission_id: string
          submission_type: string
          waiting_time: unknown
        }[]
      }
      cleanup_expired_sessions: { Args: never; Returns: undefined }
      cleanup_old_page_views: { Args: never; Returns: undefined }
      cleanup_old_request_metadata: { Args: never; Returns: undefined }
      cleanup_old_versions: {
        Args: { entity_type: string; keep_versions?: number }
        Returns: number
      }
      cleanup_orphaned_submissions: { Args: never; Returns: number }
      cleanup_rate_limits: { Args: never; Returns: undefined }
      create_submission_with_items: {
        Args: {
          p_content: Json
          p_items: Json[]
          p_submission_type: string
          p_user_id: string
        }
        Returns: string
      }
      extend_submission_lock: {
        Args: {
          extension_duration?: unknown
          moderator_id: string
          submission_id: string
        }
        Returns: string
      }
      extract_cf_image_id: { Args: { url: string }; Returns: string }
      generate_deletion_confirmation_code: { Args: never; Returns: string }
      generate_notification_idempotency_key: {
        Args: {
          p_entity_id: string
          p_event_data?: Json
          p_notification_type: string
          p_recipient_id: string
        }
        Returns: string
      }
      generate_ticket_number: { Args: never; Returns: string }
      get_auth0_sub_from_jwt: { Args: never; Returns: string }
      get_current_user_id: { Args: never; Returns: string }
      get_email_change_status: { Args: never; Returns: Json }
      get_filtered_profile: {
        Args: { _profile_user_id: string; _viewer_id?: string }
        Returns: Json
      }
      get_my_sessions: {
        Args: never
        Returns: {
          aal: string
          created_at: string
          id: string
          ip: string
          not_after: string
          refreshed_at: string
          updated_at: string
          user_agent: string
        }[]
      }
      get_orphaned_edit_history: {
        Args: never
        Returns: {
          id: string
        }[]
      }
      get_recent_changes: {
        Args: { limit_count?: number }
        Returns: {
          change_reason: string
          change_type: string
          changed_at: string
          changed_by_avatar: string
          changed_by_username: string
          entity_id: string
          entity_name: string
          entity_slug: string
          entity_type: string
          image_url: string
          park_slug: string
        }[]
      }
      get_submission_item_dependencies: {
        Args: { item_id: string }
        Returns: {
          dependency_level: number
          dependent_item_id: string
          dependent_item_type: string
        }[]
      }
      get_user_management_permissions: {
        Args: { _user_id: string }
        Returns: Json
      }
      get_users_with_emails: {
        Args: never
        Returns: {
          avatar_url: string
          banned: boolean
          created_at: string
          display_name: string
          email: string
          id: string
          user_id: string
          username: string
        }[]
      }
      get_version_diff: {
        Args: {
          p_entity_type: string
          p_from_version_id: string
          p_to_version_id: string
        }
        Returns: Json
      }
      has_aal2: { Args: never; Returns: boolean }
      has_auth0_mfa: { Args: never; Returns: boolean }
      has_mfa_enabled: { Args: { _user_id: string }; Returns: boolean }
      has_pending_dependents: { Args: { item_id: string }; Returns: boolean }
      has_role: {
        Args: {
          _role: Database["public"]["Enums"]["app_role"]
          _user_id: string
        }
        Returns: boolean
      }
      hash_ip_address: { Args: { ip_text: string }; Returns: string }
      hash_session_ip: { Args: { session_ip: unknown }; Returns: string }
      immutable_date: { Args: { ts: string }; Returns: string }
      increment_blog_view_count: {
        Args: { post_slug: string }
        Returns: undefined
      }
      is_auth0_user: { Args: never; Returns: boolean }
      is_moderator: { Args: { _user_id: string }; Returns: boolean }
      is_superuser: { Args: { _user_id: string }; Returns: boolean }
      is_user_banned: { Args: { _user_id: string }; Returns: boolean }
      log_admin_action: {
        Args: {
          _action: string
          _admin_user_id: string
          _details?: Json
          _target_user_id: string
        }
        Returns: undefined
      }
      log_cleanup_results: { Args: never; Returns: undefined }
      log_moderation_action: {
        Args: {
          _action: string
          _metadata?: Json
          _new_status?: string
          _notes?: string
          _previous_status?: string
          _submission_id: string
        }
        Returns: string
      }
      log_request_metadata: {
        Args: {
          p_client_version?: string
          p_duration_ms?: number
          p_endpoint?: string
          p_error_message?: string
          p_error_type?: string
          p_method?: string
          p_parent_request_id?: string
          p_request_id: string
          p_status_code?: number
          p_trace_id?: string
          p_user_agent?: string
          p_user_id?: string
        }
        Returns: undefined
      }
      migrate_ride_technical_data: { Args: never; Returns: undefined }
      migrate_user_list_items: { Args: never; Returns: undefined }
      release_expired_locks: { Args: never; Returns: number }
      release_submission_lock: {
        Args: { moderator_id: string; submission_id: string }
        Returns: boolean
      }
      reorder_ride_credit: {
        Args: { p_credit_id: string; p_new_position: number }
        Returns: undefined
      }
      revoke_my_session: { Args: { session_id: string }; Returns: undefined }
      revoke_session_with_mfa: {
        Args: { target_session_id: string; target_user_id: string }
        Returns: Json
      }
      rollback_to_version: {
        Args: {
          p_changed_by: string
          p_entity_id: string
          p_entity_type: string
          p_reason: string
          p_target_version_id: string
        }
        Returns: string
      }
      set_config_value: {
        Args: {
          is_local?: boolean
          setting_name: string
          setting_value: string
        }
        Returns: undefined
      }
      update_company_ratings: {
        Args: { target_company_id: string }
        Returns: undefined
      }
      update_entity_view_counts: { Args: never; Returns: undefined }
      update_park_ratings: {
        Args: { target_park_id: string }
        Returns: undefined
      }
      update_park_ride_counts: {
        Args: { target_park_id: string }
        Returns: undefined
      }
      update_profile: {
        Args: {
          p_avatar_image_id?: string
          p_avatar_url?: string
          p_bio?: string
          p_display_name?: string
          p_personal_location?: string
          p_preferred_pronouns?: string
          p_username?: string
        }
        Returns: Json
      }
      update_ride_ratings: {
        Args: { target_ride_id: string }
        Returns: undefined
      }
      validate_moderation_action: {
        Args: { _action: string; _submission_id: string; _user_id: string }
        Returns: boolean
      }
    }
    Enums: {
      account_deletion_status:
        | "pending"
        | "confirmed"
        | "cancelled"
        | "completed"
      app_role: "admin" | "moderator" | "user" | "superuser"
      version_change_type:
        | "created"
        | "updated"
        | "deleted"
        | "restored"
        | "archived"
    }
    CompositeTypes: {
      [_ in never]: never
    }
  }
}

type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">

type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]

export type Tables<
  DefaultSchemaTableNameOrOptions extends
    | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
        DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
      DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
      Row: infer R
    }
    ? R
    : never
  : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] &
        DefaultSchema["Views"])
    ? (DefaultSchema["Tables"] &
        DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
        Row: infer R
      }
      ? R
      : never
    : never

export type TablesInsert<
  DefaultSchemaTableNameOrOptions extends
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Insert: infer I
    }
    ? I
    : never
  : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
    ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
        Insert: infer I
      }
      ? I
      : never
    : never

export type TablesUpdate<
  DefaultSchemaTableNameOrOptions extends
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Update: infer U
    }
    ? U
    : never
  : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
    ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
        Update: infer U
      }
      ? U
      : never
    : never

export type Enums<
  DefaultSchemaEnumNameOrOptions extends
    | keyof DefaultSchema["Enums"]
    | { schema: keyof DatabaseWithoutInternals },
  EnumName extends DefaultSchemaEnumNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
    : never = never,
> = DefaultSchemaEnumNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
  : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
    ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
    : never

export type CompositeTypes<
  PublicCompositeTypeNameOrOptions extends
    | keyof DefaultSchema["CompositeTypes"]
    | { schema: keyof DatabaseWithoutInternals },
  CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
    : never = never,
> = PublicCompositeTypeNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
  : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
    ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
    : never

export const Constants = {
  public: {
    Enums: {
      account_deletion_status: [
        "pending",
        "confirmed",
        "cancelled",
        "completed",
      ],
      app_role: ["admin", "moderator", "user", "superuser"],
      version_change_type: [
        "created",
        "updated",
        "deleted",
        "restored",
        "archived",
      ],
    },
  },
} as const
