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: "14.1"
  }
  public: {
    Tables: {
      access_grant: {
        Row: {
          created_at: number
          id: string
          permission: string
          principal_id: string
          principal_type: string
          resource_id: string
          resource_type: string
        }
        Insert: {
          created_at: number
          id: string
          permission: string
          principal_id: string
          principal_type: string
          resource_id: string
          resource_type: string
        }
        Update: {
          created_at?: number
          id?: string
          permission?: string
          principal_id?: string
          principal_type?: string
          resource_id?: string
          resource_type?: string
        }
        Relationships: []
      }
      achievements: {
        Row: {
          category: string | null
          created_at: string | null
          description: string | null
          icon: string | null
          id: string
          requirement_type: string | null
          requirement_value: number | null
          slug: string
          title: string
          xp_reward: number | null
        }
        Insert: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          icon?: string | null
          id?: string
          requirement_type?: string | null
          requirement_value?: number | null
          slug: string
          title: string
          xp_reward?: number | null
        }
        Update: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          icon?: string | null
          id?: string
          requirement_type?: string | null
          requirement_value?: number | null
          slug?: string
          title?: string
          xp_reward?: number | null
        }
        Relationships: []
      }
      activity_achievement_events: {
        Row: {
          achievement_description: string | null
          achievement_key: string
          achievement_name: string
          created_at: string
          delivered: boolean | null
          delivered_at: string | null
          guild_id: string | null
          id: string
          source: string
          user_id: string
          xp_awarded: number | null
        }
        Insert: {
          achievement_description?: string | null
          achievement_key: string
          achievement_name: string
          created_at?: string
          delivered?: boolean | null
          delivered_at?: string | null
          guild_id?: string | null
          id?: string
          source: string
          user_id: string
          xp_awarded?: number | null
        }
        Update: {
          achievement_description?: string | null
          achievement_key?: string
          achievement_name?: string
          created_at?: string
          delivered?: boolean | null
          delivered_at?: string | null
          guild_id?: string | null
          id?: string
          source?: string
          user_id?: string
          xp_awarded?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_achievement_events_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_events: {
        Row: {
          actor_id: string
          created_at: string
          id: string
          metadata: Json | null
          object_id: string | null
          object_type: string
          target_id: string | null
          verb: string
        }
        Insert: {
          actor_id: string
          created_at?: string
          id?: string
          metadata?: Json | null
          object_id?: string | null
          object_type: string
          target_id?: string | null
          verb: string
        }
        Update: {
          actor_id?: string
          created_at?: string
          id?: string
          metadata?: Json | null
          object_id?: string | null
          object_type?: string
          target_id?: string | null
          verb?: string
        }
        Relationships: [
          {
            foreignKeyName: "activity_events_actor_id_fkey"
            columns: ["actor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_feed_events: {
        Row: {
          created_at: string
          description: string | null
          event_type: string
          guild_id: string | null
          id: string
          metadata: Json | null
          target_user_id: string | null
          target_username: string | null
          title: string
          user_id: string | null
          username: string | null
        }
        Insert: {
          created_at?: string
          description?: string | null
          event_type: string
          guild_id?: string | null
          id?: string
          metadata?: Json | null
          target_user_id?: string | null
          target_username?: string | null
          title: string
          user_id?: string | null
          username?: string | null
        }
        Update: {
          created_at?: string
          description?: string | null
          event_type?: string
          guild_id?: string | null
          id?: string
          metadata?: Json | null
          target_user_id?: string | null
          target_username?: string | null
          title?: string
          user_id?: string | null
          username?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_feed_events_target_user_id_fkey"
            columns: ["target_user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "activity_feed_events_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_focus_pod_members: {
        Row: {
          id: string
          joined_at: string
          left_at: string | null
          pod_id: string
          role: string | null
          user_id: string
          xp_earned: number | null
        }
        Insert: {
          id?: string
          joined_at?: string
          left_at?: string | null
          pod_id: string
          role?: string | null
          user_id: string
          xp_earned?: number | null
        }
        Update: {
          id?: string
          joined_at?: string
          left_at?: string | null
          pod_id?: string
          role?: string | null
          user_id?: string
          xp_earned?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_focus_pod_members_pod_id_fkey"
            columns: ["pod_id"]
            isOneToOne: false
            referencedRelation: "activity_focus_pods"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "activity_focus_pod_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_focus_pods: {
        Row: {
          actual_end: string | null
          actual_start: string | null
          channel_id: string | null
          created_at: string
          guild_id: string
          host_id: string
          id: string
          max_members: number | null
          purpose: string | null
          scheduled_end: string | null
          scheduled_start: string | null
          status: string
          title: string
          updated_at: string
          xp_per_participant: number | null
        }
        Insert: {
          actual_end?: string | null
          actual_start?: string | null
          channel_id?: string | null
          created_at?: string
          guild_id: string
          host_id: string
          id?: string
          max_members?: number | null
          purpose?: string | null
          scheduled_end?: string | null
          scheduled_start?: string | null
          status?: string
          title: string
          updated_at?: string
          xp_per_participant?: number | null
        }
        Update: {
          actual_end?: string | null
          actual_start?: string | null
          channel_id?: string | null
          created_at?: string
          guild_id?: string
          host_id?: string
          id?: string
          max_members?: number | null
          purpose?: string | null
          scheduled_end?: string | null
          scheduled_start?: string | null
          status?: string
          title?: string
          updated_at?: string
          xp_per_participant?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_focus_pods_host_id_fkey"
            columns: ["host_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_logs: {
        Row: {
          action: string
          details: string | null
          id: string
          ip_address: string | null
          status: string
          timestamp: string
          user_agent: string | null
          user_id: string | null
        }
        Insert: {
          action: string
          details?: string | null
          id?: string
          ip_address?: string | null
          status: string
          timestamp?: string
          user_agent?: string | null
          user_id?: string | null
        }
        Update: {
          action?: string
          details?: string | null
          id?: string
          ip_address?: string | null
          status?: string
          timestamp?: string
          user_agent?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_logs_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_metrics_daily: {
        Row: {
          active_users: number | null
          bounties_completed: number | null
          created_at: string
          date: string
          guild_id: string
          id: string
          missions_completed: number | null
          pods_completed: number | null
          total_focus_minutes: number | null
          updated_at: string
          xp_earned: number | null
        }
        Insert: {
          active_users?: number | null
          bounties_completed?: number | null
          created_at?: string
          date: string
          guild_id: string
          id?: string
          missions_completed?: number | null
          pods_completed?: number | null
          total_focus_minutes?: number | null
          updated_at?: string
          xp_earned?: number | null
        }
        Update: {
          active_users?: number | null
          bounties_completed?: number | null
          created_at?: string
          date?: string
          guild_id?: string
          id?: string
          missions_completed?: number | null
          pods_completed?: number | null
          total_focus_minutes?: number | null
          updated_at?: string
          xp_earned?: number | null
        }
        Relationships: []
      }
      activity_mission_instances: {
        Row: {
          completed_at: string | null
          created_at: string
          date: string
          focus_end: string | null
          focus_start: string | null
          guild_id: string
          id: string
          mission_id: string | null
          notes: string | null
          owner_id: string
          status: string
          updated_at: string
        }
        Insert: {
          completed_at?: string | null
          created_at?: string
          date?: string
          focus_end?: string | null
          focus_start?: string | null
          guild_id: string
          id?: string
          mission_id?: string | null
          notes?: string | null
          owner_id: string
          status?: string
          updated_at?: string
        }
        Update: {
          completed_at?: string | null
          created_at?: string
          date?: string
          focus_end?: string | null
          focus_start?: string | null
          guild_id?: string
          id?: string
          mission_id?: string | null
          notes?: string | null
          owner_id?: string
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "activity_mission_instances_mission_id_fkey"
            columns: ["mission_id"]
            isOneToOne: false
            referencedRelation: "activity_missions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "activity_mission_instances_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      activity_missions: {
        Row: {
          created_at: string
          created_by: string | null
          description: string | null
          guild_id: string | null
          id: string
          is_template: boolean | null
          mission_type: string
          title: string
          xp_reward: number | null
        }
        Insert: {
          created_at?: string
          created_by?: string | null
          description?: string | null
          guild_id?: string | null
          id?: string
          is_template?: boolean | null
          mission_type?: string
          title: string
          xp_reward?: number | null
        }
        Update: {
          created_at?: string
          created_by?: string | null
          description?: string | null
          guild_id?: string | null
          id?: string
          is_template?: boolean | null
          mission_type?: string
          title?: string
          xp_reward?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "activity_missions_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_alerts: {
        Row: {
          created_at: string | null
          id: string
          is_resolved: boolean | null
          message: string
          resolved_at: string | null
          severity: string
          site_id: string | null
          type: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          is_resolved?: boolean | null
          message: string
          resolved_at?: string | null
          severity: string
          site_id?: string | null
          type: string
        }
        Update: {
          created_at?: string | null
          id?: string
          is_resolved?: boolean | null
          message?: string
          resolved_at?: string | null
          severity?: string
          site_id?: string | null
          type?: string
        }
        Relationships: [
          {
            foreignKeyName: "aethex_alerts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_alerts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      aethex_applications: {
        Row: {
          applied_at: string | null
          cover_letter: string | null
          creator_id: string
          id: string
          opportunity_id: string
          response_message: string | null
          status: string | null
          updated_at: string | null
        }
        Insert: {
          applied_at?: string | null
          cover_letter?: string | null
          creator_id: string
          id?: string
          opportunity_id: string
          response_message?: string | null
          status?: string | null
          updated_at?: string | null
        }
        Update: {
          applied_at?: string | null
          cover_letter?: string | null
          creator_id?: string
          id?: string
          opportunity_id?: string
          response_message?: string | null
          status?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_applications_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_applications_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "aethex_opportunities"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_audit_log: {
        Row: {
          action: string
          actor_id: string | null
          actor_type: string
          changes: Json | null
          created_at: string | null
          error_message: string | null
          id: string
          ip_address: string | null
          resource_id: string
          resource_type: string
          status: string | null
          user_agent: string | null
        }
        Insert: {
          action: string
          actor_id?: string | null
          actor_type: string
          changes?: Json | null
          created_at?: string | null
          error_message?: string | null
          id?: string
          ip_address?: string | null
          resource_id: string
          resource_type: string
          status?: string | null
          user_agent?: string | null
        }
        Update: {
          action?: string
          actor_id?: string | null
          actor_type?: string
          changes?: Json | null
          created_at?: string | null
          error_message?: string | null
          id?: string
          ip_address?: string | null
          resource_id?: string
          resource_type?: string
          status?: string | null
          user_agent?: string | null
        }
        Relationships: []
      }
      aethex_badges: {
        Row: {
          color: string | null
          created_at: string
          description: string | null
          icon: string | null
          id: string
          name: string
        }
        Insert: {
          color?: string | null
          created_at?: string
          description?: string | null
          icon?: string | null
          id?: string
          name: string
        }
        Update: {
          color?: string | null
          created_at?: string
          description?: string | null
          icon?: string | null
          id?: string
          name?: string
        }
        Relationships: []
      }
      aethex_creators: {
        Row: {
          allow_recommendations: boolean | null
          arm_affiliations: string[] | null
          avatar_url: string | null
          bio: string | null
          created_at: string | null
          devconnect_linked: boolean | null
          experience_level: string | null
          id: string
          is_discoverable: boolean | null
          primary_arm: string | null
          skills: string[] | null
          spotify_profile_url: string | null
          updated_at: string | null
          user_id: string
          username: string
        }
        Insert: {
          allow_recommendations?: boolean | null
          arm_affiliations?: string[] | null
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          devconnect_linked?: boolean | null
          experience_level?: string | null
          id?: string
          is_discoverable?: boolean | null
          primary_arm?: string | null
          skills?: string[] | null
          spotify_profile_url?: string | null
          updated_at?: string | null
          user_id: string
          username: string
        }
        Update: {
          allow_recommendations?: boolean | null
          arm_affiliations?: string[] | null
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          devconnect_linked?: boolean | null
          experience_level?: string | null
          id?: string
          is_discoverable?: boolean | null
          primary_arm?: string | null
          skills?: string[] | null
          spotify_profile_url?: string | null
          updated_at?: string | null
          user_id?: string
          username?: string
        }
        Relationships: []
      }
      aethex_devconnect_links: {
        Row: {
          aethex_creator_id: string
          devconnect_profile_url: string | null
          devconnect_username: string
          id: string
          linked_at: string | null
          verified: boolean | null
        }
        Insert: {
          aethex_creator_id: string
          devconnect_profile_url?: string | null
          devconnect_username: string
          id?: string
          linked_at?: string | null
          verified?: boolean | null
        }
        Update: {
          aethex_creator_id?: string
          devconnect_profile_url?: string | null
          devconnect_username?: string
          id?: string
          linked_at?: string | null
          verified?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_devconnect_links_aethex_creator_id_fkey"
            columns: ["aethex_creator_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_entitlement_events: {
        Row: {
          actor_id: string | null
          actor_type: string
          created_at: string | null
          entitlement_id: string
          event_type: string
          id: string
          metadata: Json | null
          reason: string | null
        }
        Insert: {
          actor_id?: string | null
          actor_type: string
          created_at?: string | null
          entitlement_id: string
          event_type: string
          id?: string
          metadata?: Json | null
          reason?: string | null
        }
        Update: {
          actor_id?: string | null
          actor_type?: string
          created_at?: string | null
          entitlement_id?: string
          event_type?: string
          id?: string
          metadata?: Json | null
          reason?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_entitlement_events_entitlement_id_fkey"
            columns: ["entitlement_id"]
            isOneToOne: false
            referencedRelation: "aethex_entitlements"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_entitlements: {
        Row: {
          created_at: string | null
          data: Json
          entitlement_type: string
          evidence_hash: string | null
          expires_at: string | null
          external_subject_ref: string | null
          id: string
          issued_by_subject_id: string | null
          issuer_id: string
          revocation_reason: string | null
          revoked_at: string | null
          schema_version: string | null
          scope: string
          signature: string | null
          status: string | null
          subject_id: string | null
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          data: Json
          entitlement_type: string
          evidence_hash?: string | null
          expires_at?: string | null
          external_subject_ref?: string | null
          id?: string
          issued_by_subject_id?: string | null
          issuer_id: string
          revocation_reason?: string | null
          revoked_at?: string | null
          schema_version?: string | null
          scope: string
          signature?: string | null
          status?: string | null
          subject_id?: string | null
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          data?: Json
          entitlement_type?: string
          evidence_hash?: string | null
          expires_at?: string | null
          external_subject_ref?: string | null
          id?: string
          issued_by_subject_id?: string | null
          issuer_id?: string
          revocation_reason?: string | null
          revoked_at?: string | null
          schema_version?: string | null
          scope?: string
          signature?: string | null
          status?: string | null
          subject_id?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_entitlements_issuer_id_fkey"
            columns: ["issuer_id"]
            isOneToOne: false
            referencedRelation: "aethex_issuers"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_entitlements_subject_id_fkey"
            columns: ["subject_id"]
            isOneToOne: false
            referencedRelation: "aethex_subjects"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_event_registrations: {
        Row: {
          event_id: string
          id: string
          registered_at: string
          user_id: string
        }
        Insert: {
          event_id: string
          id?: string
          registered_at?: string
          user_id: string
        }
        Update: {
          event_id?: string
          id?: string
          registered_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "aethex_event_registrations_event_id_fkey"
            columns: ["event_id"]
            isOneToOne: false
            referencedRelation: "aethex_events"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_event_registrations_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_events: {
        Row: {
          agenda: Json | null
          capacity: number | null
          category: string | null
          created_at: string
          date: string
          description: string | null
          featured: boolean | null
          full_description: string | null
          id: string
          image_url: string | null
          location: string | null
          map_url: string | null
          price: number | null
          site_id: string | null
          speakers: string[] | null
          ticket_types: Json | null
          time: string
          title: string
          updated_at: string | null
        }
        Insert: {
          agenda?: Json | null
          capacity?: number | null
          category?: string | null
          created_at?: string
          date: string
          description?: string | null
          featured?: boolean | null
          full_description?: string | null
          id?: string
          image_url?: string | null
          location?: string | null
          map_url?: string | null
          price?: number | null
          site_id?: string | null
          speakers?: string[] | null
          ticket_types?: Json | null
          time: string
          title: string
          updated_at?: string | null
        }
        Update: {
          agenda?: Json | null
          capacity?: number | null
          category?: string | null
          created_at?: string
          date?: string
          description?: string | null
          featured?: boolean | null
          full_description?: string | null
          id?: string
          image_url?: string | null
          location?: string | null
          map_url?: string | null
          price?: number | null
          site_id?: string | null
          speakers?: string[] | null
          ticket_types?: Json | null
          time?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_events_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_events_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      aethex_issuer_keys: {
        Row: {
          created_at: string | null
          id: string
          is_active: boolean | null
          issuer_id: string
          private_key_hash: string | null
          public_key: string
          rotated_at: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          is_active?: boolean | null
          issuer_id: string
          private_key_hash?: string | null
          public_key: string
          rotated_at?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          is_active?: boolean | null
          issuer_id?: string
          private_key_hash?: string | null
          public_key?: string
          rotated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_issuer_keys_issuer_id_fkey"
            columns: ["issuer_id"]
            isOneToOne: false
            referencedRelation: "aethex_issuers"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_issuers: {
        Row: {
          created_at: string | null
          id: string
          is_active: boolean | null
          issuer_class: string
          metadata: Json | null
          name: string
          public_key: string
          scopes: Json | null
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          is_active?: boolean | null
          issuer_class: string
          metadata?: Json | null
          name: string
          public_key: string
          scopes?: Json | null
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          is_active?: boolean | null
          issuer_class?: string
          metadata?: Json | null
          name?: string
          public_key?: string
          scopes?: Json | null
          updated_at?: string | null
        }
        Relationships: []
      }
      aethex_opportunities: {
        Row: {
          arm_affiliation: string
          created_at: string | null
          description: string
          experience_level: string | null
          id: string
          job_type: string
          posted_by_id: string
          salary_max: number | null
          salary_min: number | null
          status: string | null
          title: string
          updated_at: string | null
        }
        Insert: {
          arm_affiliation: string
          created_at?: string | null
          description: string
          experience_level?: string | null
          id?: string
          job_type: string
          posted_by_id: string
          salary_max?: number | null
          salary_min?: number | null
          status?: string | null
          title: string
          updated_at?: string | null
        }
        Update: {
          arm_affiliation?: string
          created_at?: string | null
          description?: string
          experience_level?: string | null
          id?: string
          job_type?: string
          posted_by_id?: string
          salary_max?: number | null
          salary_min?: number | null
          status?: string | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_opportunities_posted_by_id_fkey"
            columns: ["posted_by_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_passports: {
        Row: {
          created_at: string
          id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          user_id: string
        }
        Update: {
          created_at?: string
          id?: string
          user_id?: string
        }
        Relationships: []
      }
      aethex_projects: {
        Row: {
          created_at: string | null
          creator_id: string
          description: string | null
          id: string
          image_url: string | null
          is_featured: boolean | null
          tags: string[] | null
          title: string
          updated_at: string | null
          url: string | null
        }
        Insert: {
          created_at?: string | null
          creator_id: string
          description?: string | null
          id?: string
          image_url?: string | null
          is_featured?: boolean | null
          tags?: string[] | null
          title: string
          updated_at?: string | null
          url?: string | null
        }
        Update: {
          created_at?: string | null
          creator_id?: string
          description?: string | null
          id?: string
          image_url?: string | null
          is_featured?: boolean | null
          tags?: string[] | null
          title?: string
          updated_at?: string | null
          url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_projects_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_sites: {
        Row: {
          api_key_hash: string | null
          created_at: string
          handshake_token: string | null
          handshake_token_expires_at: string | null
          id: string
          last_check: string | null
          metrics: Json | null
          metrics_history: Json[] | null
          name: string
          owner_id: string | null
          requests: number | null
          response_time: number | null
          services: string[] | null
          status: string | null
          uptime: number | null
          url: string | null
          users: number | null
        }
        Insert: {
          api_key_hash?: string | null
          created_at?: string
          handshake_token?: string | null
          handshake_token_expires_at?: string | null
          id?: string
          last_check?: string | null
          metrics?: Json | null
          metrics_history?: Json[] | null
          name: string
          owner_id?: string | null
          requests?: number | null
          response_time?: number | null
          services?: string[] | null
          status?: string | null
          uptime?: number | null
          url?: string | null
          users?: number | null
        }
        Update: {
          api_key_hash?: string | null
          created_at?: string
          handshake_token?: string | null
          handshake_token_expires_at?: string | null
          id?: string
          last_check?: string | null
          metrics?: Json | null
          metrics_history?: Json[] | null
          name?: string
          owner_id?: string | null
          requests?: number | null
          response_time?: number | null
          services?: string[] | null
          status?: string | null
          uptime?: number | null
          url?: string | null
          users?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_sites_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_skill_endorsements: {
        Row: {
          created_at: string | null
          creator_id: string
          endorsed_by_id: string
          id: string
          skill: string
        }
        Insert: {
          created_at?: string | null
          creator_id: string
          endorsed_by_id: string
          id?: string
          skill: string
        }
        Update: {
          created_at?: string | null
          creator_id?: string
          endorsed_by_id?: string
          id?: string
          skill?: string
        }
        Relationships: [
          {
            foreignKeyName: "aethex_skill_endorsements_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "aethex_skill_endorsements_endorsed_by_id_fkey"
            columns: ["endorsed_by_id"]
            isOneToOne: false
            referencedRelation: "aethex_creators"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_subject_identities: {
        Row: {
          created_at: string | null
          external_id: string
          external_username: string | null
          id: string
          provider: string
          revoked_at: string | null
          subject_id: string
          verified_at: string | null
        }
        Insert: {
          created_at?: string | null
          external_id: string
          external_username?: string | null
          id?: string
          provider: string
          revoked_at?: string | null
          subject_id: string
          verified_at?: string | null
        }
        Update: {
          created_at?: string | null
          external_id?: string
          external_username?: string | null
          id?: string
          provider?: string
          revoked_at?: string | null
          subject_id?: string
          verified_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "aethex_subject_identities_subject_id_fkey"
            columns: ["subject_id"]
            isOneToOne: false
            referencedRelation: "aethex_subjects"
            referencedColumns: ["id"]
          },
        ]
      }
      aethex_subjects: {
        Row: {
          created_at: string | null
          id: string
        }
        Insert: {
          created_at?: string | null
          id?: string
        }
        Update: {
          created_at?: string | null
          id?: string
        }
        Relationships: []
      }
      aethex_user_mode_preference: {
        Row: {
          created_at: string | null
          id: string
          mode: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          mode?: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          id?: string
          mode?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: []
      }
      aethex_workspace_policy: {
        Row: {
          allowed_modes: Json | null
          commerce_enabled: boolean | null
          created_at: string | null
          enforced_realm: string | null
          id: string
          messaging_enabled: boolean | null
          social_enabled: boolean | null
          updated_at: string | null
          workspace_id: string
        }
        Insert: {
          allowed_modes?: Json | null
          commerce_enabled?: boolean | null
          created_at?: string | null
          enforced_realm?: string | null
          id?: string
          messaging_enabled?: boolean | null
          social_enabled?: boolean | null
          updated_at?: string | null
          workspace_id: string
        }
        Update: {
          allowed_modes?: Json | null
          commerce_enabled?: boolean | null
          created_at?: string | null
          enforced_realm?: string | null
          id?: string
          messaging_enabled?: boolean | null
          social_enabled?: boolean | null
          updated_at?: string | null
          workspace_id?: string
        }
        Relationships: []
      }
      alembic_version: {
        Row: {
          version_num: string
        }
        Insert: {
          version_num: string
        }
        Update: {
          version_num?: string
        }
        Relationships: []
      }
      announcements: {
        Row: {
          author_id: string | null
          content: string | null
          created_at: string | null
          id: string
          site_id: string | null
          title: string
        }
        Insert: {
          author_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          site_id?: string | null
          title: string
        }
        Update: {
          author_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          site_id?: string | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "announcements_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "announcements_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "announcements_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      api_key: {
        Row: {
          created_at: number
          data: Json | null
          expires_at: number | null
          id: string
          key: string
          last_used_at: number | null
          updated_at: number
          user_id: string | null
        }
        Insert: {
          created_at: number
          data?: Json | null
          expires_at?: number | null
          id: string
          key: string
          last_used_at?: number | null
          updated_at: number
          user_id?: string | null
        }
        Update: {
          created_at?: number
          data?: Json | null
          expires_at?: number | null
          id?: string
          key?: string
          last_used_at?: number | null
          updated_at?: number
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "api_key_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user"
            referencedColumns: ["id"]
          },
        ]
      }
      api_keys: {
        Row: {
          api_key: string
          created_at: string
          expires_at: string | null
          id: string
          last_used_at: string | null
          name: string
          user_id: string
        }
        Insert: {
          api_key: string
          created_at?: string
          expires_at?: string | null
          id?: string
          last_used_at?: string | null
          name: string
          user_id: string
        }
        Update: {
          api_key?: string
          created_at?: string
          expires_at?: string | null
          id?: string
          last_used_at?: string | null
          name?: string
          user_id?: string
        }
        Relationships: []
      }
      api_rate_limits: {
        Row: {
          api_key_id: string
          day_window: string
          id: string
          minute_window: string
          requests_this_day: number | null
          requests_this_minute: number | null
          updated_at: string | null
        }
        Insert: {
          api_key_id: string
          day_window: string
          id?: string
          minute_window: string
          requests_this_day?: number | null
          requests_this_minute?: number | null
          updated_at?: string | null
        }
        Update: {
          api_key_id?: string
          day_window?: string
          id?: string
          minute_window?: string
          requests_this_day?: number | null
          requests_this_minute?: number | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "api_rate_limits_api_key_id_fkey"
            columns: ["api_key_id"]
            isOneToOne: false
            referencedRelation: "developer_api_keys"
            referencedColumns: ["id"]
          },
        ]
      }
      api_usage_logs: {
        Row: {
          api_key_id: string
          endpoint: string
          error_message: string | null
          id: string
          ip_address: string | null
          method: string
          response_time_ms: number | null
          status_code: number
          timestamp: string | null
          user_agent: string | null
          user_id: string
        }
        Insert: {
          api_key_id: string
          endpoint: string
          error_message?: string | null
          id?: string
          ip_address?: string | null
          method: string
          response_time_ms?: number | null
          status_code: number
          timestamp?: string | null
          user_agent?: string | null
          user_id: string
        }
        Update: {
          api_key_id?: string
          endpoint?: string
          error_message?: string | null
          id?: string
          ip_address?: string | null
          method?: string
          response_time_ms?: number | null
          status_code?: number
          timestamp?: string | null
          user_agent?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "api_usage_logs_api_key_id_fkey"
            columns: ["api_key_id"]
            isOneToOne: false
            referencedRelation: "developer_api_keys"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "api_usage_logs_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_achievements: {
        Row: {
          active: boolean | null
          category: string
          created_at: string
          criteria: Json
          description: string | null
          icon_url: string | null
          id: string
          name: string
          points: number | null
          rarity: string | null
          rewards: Json | null
          type: string
        }
        Insert: {
          active?: boolean | null
          category: string
          created_at?: string
          criteria: Json
          description?: string | null
          icon_url?: string | null
          id?: string
          name: string
          points?: number | null
          rarity?: string | null
          rewards?: Json | null
          type: string
        }
        Update: {
          active?: boolean | null
          category?: string
          created_at?: string
          criteria?: Json
          description?: string | null
          icon_url?: string | null
          id?: string
          name?: string
          points?: number | null
          rarity?: string | null
          rewards?: Json | null
          type?: string
        }
        Relationships: []
      }
      app_2db261233c_admin_logs: {
        Row: {
          action: string
          admin_id: string
          created_at: string
          details: Json | null
          id: string
          ip_address: unknown
          target_id: string | null
          target_type: string | null
          user_agent: string | null
        }
        Insert: {
          action: string
          admin_id: string
          created_at?: string
          details?: Json | null
          id?: string
          ip_address?: unknown
          target_id?: string | null
          target_type?: string | null
          user_agent?: string | null
        }
        Update: {
          action?: string
          admin_id?: string
          created_at?: string
          details?: Json | null
          id?: string
          ip_address?: unknown
          target_id?: string | null
          target_type?: string | null
          user_agent?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_admin_logs_admin_id_fkey"
            columns: ["admin_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_comments: {
        Row: {
          content: string
          content_id: string | null
          created_at: string
          id: string
          likes_count: number | null
          parent_id: string | null
          post_id: string | null
          user_id: string
        }
        Insert: {
          content: string
          content_id?: string | null
          created_at?: string
          id?: string
          likes_count?: number | null
          parent_id?: string | null
          post_id?: string | null
          user_id: string
        }
        Update: {
          content?: string
          content_id?: string | null
          created_at?: string
          id?: string
          likes_count?: number | null
          parent_id?: string | null
          post_id?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_comments_content_id_fkey"
            columns: ["content_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_content"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_comments_parent_id_fkey"
            columns: ["parent_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_content: {
        Row: {
          category: string | null
          comments_count: number | null
          content_url: string | null
          created_at: string
          description: string | null
          featured: boolean | null
          id: string
          likes_count: number | null
          metadata: Json | null
          shares_count: number | null
          status: string | null
          tags: string[] | null
          thumbnail_url: string | null
          title: string
          type: string
          updated_at: string
          user_id: string
          views_count: number | null
          visibility: string | null
        }
        Insert: {
          category?: string | null
          comments_count?: number | null
          content_url?: string | null
          created_at?: string
          description?: string | null
          featured?: boolean | null
          id?: string
          likes_count?: number | null
          metadata?: Json | null
          shares_count?: number | null
          status?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title: string
          type: string
          updated_at?: string
          user_id: string
          views_count?: number | null
          visibility?: string | null
        }
        Update: {
          category?: string | null
          comments_count?: number | null
          content_url?: string | null
          created_at?: string
          description?: string | null
          featured?: boolean | null
          id?: string
          likes_count?: number | null
          metadata?: Json | null
          shares_count?: number | null
          status?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title?: string
          type?: string
          updated_at?: string
          user_id?: string
          views_count?: number | null
          visibility?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_content_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_follows: {
        Row: {
          created_at: string
          follower_id: string
          following_id: string
          id: string
        }
        Insert: {
          created_at?: string
          follower_id: string
          following_id: string
          id?: string
        }
        Update: {
          created_at?: string
          follower_id?: string
          following_id?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_follows_follower_id_fkey"
            columns: ["follower_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_follows_following_id_fkey"
            columns: ["following_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_gaming_stats: {
        Row: {
          best_streak: number | null
          created_at: string
          current_streak: number | null
          favorite_games: string[] | null
          games_played: number | null
          id: string
          stats: Json | null
          total_playtime: number | null
          tournaments_won: number | null
          updated_at: string
          user_id: string
          worlds_created: number | null
        }
        Insert: {
          best_streak?: number | null
          created_at?: string
          current_streak?: number | null
          favorite_games?: string[] | null
          games_played?: number | null
          id?: string
          stats?: Json | null
          total_playtime?: number | null
          tournaments_won?: number | null
          updated_at?: string
          user_id: string
          worlds_created?: number | null
        }
        Update: {
          best_streak?: number | null
          created_at?: string
          current_streak?: number | null
          favorite_games?: string[] | null
          games_played?: number | null
          id?: string
          stats?: Json | null
          total_playtime?: number | null
          tournaments_won?: number | null
          updated_at?: string
          user_id?: string
          worlds_created?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_gaming_stats_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_likes: {
        Row: {
          comment_id: string | null
          content_id: string | null
          created_at: string
          id: string
          post_id: string | null
          user_id: string
        }
        Insert: {
          comment_id?: string | null
          content_id?: string | null
          created_at?: string
          id?: string
          post_id?: string | null
          user_id: string
        }
        Update: {
          comment_id?: string | null
          content_id?: string | null
          created_at?: string
          id?: string
          post_id?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_likes_comment_id_fkey"
            columns: ["comment_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_likes_content_id_fkey"
            columns: ["content_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_content"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_notifications: {
        Row: {
          created_at: string
          data: Json | null
          id: string
          message: string | null
          read: boolean | null
          title: string
          type: string
          user_id: string
        }
        Insert: {
          created_at?: string
          data?: Json | null
          id?: string
          message?: string | null
          read?: boolean | null
          title: string
          type: string
          user_id: string
        }
        Update: {
          created_at?: string
          data?: Json | null
          id?: string
          message?: string | null
          read?: boolean | null
          title?: string
          type?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_notifications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_posts: {
        Row: {
          comments_count: number | null
          content: string
          created_at: string
          id: string
          likes_count: number | null
          media_urls: string[] | null
          shares_count: number | null
          type: string | null
          updated_at: string
          user_id: string
          visibility: string | null
        }
        Insert: {
          comments_count?: number | null
          content: string
          created_at?: string
          id?: string
          likes_count?: number | null
          media_urls?: string[] | null
          shares_count?: number | null
          type?: string | null
          updated_at?: string
          user_id: string
          visibility?: string | null
        }
        Update: {
          comments_count?: number | null
          content?: string
          created_at?: string
          id?: string
          likes_count?: number | null
          media_urls?: string[] | null
          shares_count?: number | null
          type?: string | null
          updated_at?: string
          user_id?: string
          visibility?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_posts_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_professional_profiles: {
        Row: {
          availability: string | null
          certifications: Json | null
          company: string | null
          created_at: string
          education: Json | null
          experience_years: number | null
          github_url: string | null
          id: string
          industry: string | null
          job_title: string | null
          linkedin_url: string | null
          portfolio_url: string | null
          resume_url: string | null
          salary_range: string | null
          skills: string[] | null
          updated_at: string
          user_id: string
        }
        Insert: {
          availability?: string | null
          certifications?: Json | null
          company?: string | null
          created_at?: string
          education?: Json | null
          experience_years?: number | null
          github_url?: string | null
          id?: string
          industry?: string | null
          job_title?: string | null
          linkedin_url?: string | null
          portfolio_url?: string | null
          resume_url?: string | null
          salary_range?: string | null
          skills?: string[] | null
          updated_at?: string
          user_id: string
        }
        Update: {
          availability?: string | null
          certifications?: Json | null
          company?: string | null
          created_at?: string
          education?: Json | null
          experience_years?: number | null
          github_url?: string | null
          id?: string
          industry?: string | null
          job_title?: string | null
          linkedin_url?: string | null
          portfolio_url?: string | null
          resume_url?: string | null
          salary_range?: string | null
          skills?: string[] | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_professional_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_user_achievements: {
        Row: {
          achievement_id: string
          completed: boolean | null
          completed_at: string | null
          created_at: string
          id: string
          progress: number | null
          user_id: string
        }
        Insert: {
          achievement_id: string
          completed?: boolean | null
          completed_at?: string | null
          created_at?: string
          id?: string
          progress?: number | null
          user_id: string
        }
        Update: {
          achievement_id?: string
          completed?: boolean | null
          completed_at?: string | null
          created_at?: string
          id?: string
          progress?: number | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "app_2db261233c_user_achievements_achievement_id_fkey"
            columns: ["achievement_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_achievements"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "app_2db261233c_user_achievements_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "app_2db261233c_users"
            referencedColumns: ["id"]
          },
        ]
      }
      app_2db261233c_users: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string
          full_name: string | null
          gaming_level: number | null
          gaming_xp: number | null
          id: string
          location: string | null
          notification_settings: Json | null
          privacy_settings: Json | null
          professional_tier: string | null
          social_score: number | null
          status: string | null
          total_achievements: number | null
          total_uploads: number | null
          updated_at: string
          username: string
          website: string | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          full_name?: string | null
          gaming_level?: number | null
          gaming_xp?: number | null
          id: string
          location?: string | null
          notification_settings?: Json | null
          privacy_settings?: Json | null
          professional_tier?: string | null
          social_score?: number | null
          status?: string | null
          total_achievements?: number | null
          total_uploads?: number | null
          updated_at?: string
          username: string
          website?: string | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          full_name?: string | null
          gaming_level?: number | null
          gaming_xp?: number | null
          id?: string
          location?: string | null
          notification_settings?: Json | null
          privacy_settings?: Json | null
          professional_tier?: string | null
          social_score?: number | null
          status?: string | null
          total_achievements?: number | null
          total_uploads?: number | null
          updated_at?: string
          username?: string
          website?: string | null
        }
        Relationships: []
      }
      applications: {
        Row: {
          availability: string | null
          email: string
          experience_level: string | null
          full_name: string
          id: string
          interests: string[] | null
          location: string | null
          message: string | null
          portfolio_url: string | null
          primary_skill: string | null
          resume_url: string | null
          role_interest: string | null
          status: string
          submitted_at: string
          type: string
        }
        Insert: {
          availability?: string | null
          email: string
          experience_level?: string | null
          full_name: string
          id?: string
          interests?: string[] | null
          location?: string | null
          message?: string | null
          portfolio_url?: string | null
          primary_skill?: string | null
          resume_url?: string | null
          role_interest?: string | null
          status?: string
          submitted_at?: string
          type: string
        }
        Update: {
          availability?: string | null
          email?: string
          experience_level?: string | null
          full_name?: string
          id?: string
          interests?: string[] | null
          location?: string | null
          message?: string | null
          portfolio_url?: string | null
          primary_skill?: string | null
          resume_url?: string | null
          role_interest?: string | null
          status?: string
          submitted_at?: string
          type?: string
        }
        Relationships: []
      }
      architect_waitlist: {
        Row: {
          created_at: string
          email: string
          id: string
          user_id: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          user_id?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "architect_waitlist_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      arm_competition_scores: {
        Row: {
          arm: string
          competition_id: string
          id: string
          participant_count: number
          total_score: number
          updated_at: string
        }
        Insert: {
          arm: string
          competition_id: string
          id?: string
          participant_count?: number
          total_score?: number
          updated_at?: string
        }
        Update: {
          arm?: string
          competition_id?: string
          id?: string
          participant_count?: number
          total_score?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "arm_competition_scores_competition_id_fkey"
            columns: ["competition_id"]
            isOneToOne: false
            referencedRelation: "arm_competitions"
            referencedColumns: ["id"]
          },
        ]
      }
      arm_competitions: {
        Row: {
          competition_type: string
          created_at: string
          description: string | null
          ends_at: string
          id: string
          starts_at: string
          status: string
          title: string
          updated_at: string
          winning_arm: string | null
        }
        Insert: {
          competition_type: string
          created_at?: string
          description?: string | null
          ends_at: string
          id?: string
          starts_at: string
          status?: string
          title: string
          updated_at?: string
          winning_arm?: string | null
        }
        Update: {
          competition_type?: string
          created_at?: string
          description?: string | null
          ends_at?: string
          id?: string
          starts_at?: string
          status?: string
          title?: string
          updated_at?: string
          winning_arm?: string | null
        }
        Relationships: []
      }
      arm_follows: {
        Row: {
          arm_affiliation: string
          followed_at: string | null
          id: number
          user_id: string
        }
        Insert: {
          arm_affiliation: string
          followed_at?: string | null
          id?: number
          user_id: string
        }
        Update: {
          arm_affiliation?: string
          followed_at?: string | null
          id?: number
          user_id?: string
        }
        Relationships: []
      }
      arm_memberships: {
        Row: {
          arm: string
          granted_at: string | null
          granted_by: string | null
          id: string
          role: string
          user_id: string | null
        }
        Insert: {
          arm: string
          granted_at?: string | null
          granted_by?: string | null
          id?: string
          role?: string
          user_id?: string | null
        }
        Update: {
          arm?: string
          granted_at?: string | null
          granted_by?: string | null
          id?: string
          role?: string
          user_id?: string | null
        }
        Relationships: []
      }
      asset_library: {
        Row: {
          author: string
          author_id: string | null
          browse_url: string | null
          category: string | null
          category_id: number | null
          cost: string | null
          created_at: string | null
          description: string | null
          download_commit: string | null
          download_hash: string | null
          download_url: string | null
          godot_version: string | null
          icon_url: string | null
          id: number
          issues_url: string | null
          modify_date: string | null
          previews: Json | null
          rating: number | null
          support_level: string | null
          title: string
          type: number | null
          user_id: string | null
          version: string | null
          version_string: string | null
        }
        Insert: {
          author?: string
          author_id?: string | null
          browse_url?: string | null
          category?: string | null
          category_id?: number | null
          cost?: string | null
          created_at?: string | null
          description?: string | null
          download_commit?: string | null
          download_hash?: string | null
          download_url?: string | null
          godot_version?: string | null
          icon_url?: string | null
          id?: number
          issues_url?: string | null
          modify_date?: string | null
          previews?: Json | null
          rating?: number | null
          support_level?: string | null
          title: string
          type?: number | null
          user_id?: string | null
          version?: string | null
          version_string?: string | null
        }
        Update: {
          author?: string
          author_id?: string | null
          browse_url?: string | null
          category?: string | null
          category_id?: number | null
          cost?: string | null
          created_at?: string | null
          description?: string | null
          download_commit?: string | null
          download_hash?: string | null
          download_url?: string | null
          godot_version?: string | null
          icon_url?: string | null
          id?: number
          issues_url?: string | null
          modify_date?: string | null
          previews?: Json | null
          rating?: number | null
          support_level?: string | null
          title?: string
          type?: number | null
          user_id?: string | null
          version?: string | null
          version_string?: string | null
        }
        Relationships: []
      }
      assets: {
        Row: {
          created_at: string | null
          file_type: string | null
          id: string
          name: string
          project_id: string | null
          site_id: string | null
          size: number | null
          tags: string[] | null
          updated_at: string | null
          url: string
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          file_type?: string | null
          id?: string
          name: string
          project_id?: string | null
          site_id?: string | null
          size?: number | null
          tags?: string[] | null
          updated_at?: string | null
          url: string
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          file_type?: string | null
          id?: string
          name?: string
          project_id?: string | null
          site_id?: string | null
          size?: number | null
          tags?: string[] | null
          updated_at?: string | null
          url?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "assets_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "assets_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "assets_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "assets_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      audit_logs: {
        Row: {
          action: string
          created_at: string | null
          details: Json | null
          guild_id: string
          id: number
          resource_id: string | null
          resource_type: string | null
          user_id: string
          user_tag: string | null
        }
        Insert: {
          action: string
          created_at?: string | null
          details?: Json | null
          guild_id: string
          id?: number
          resource_id?: string | null
          resource_type?: string | null
          user_id: string
          user_tag?: string | null
        }
        Update: {
          action?: string
          created_at?: string | null
          details?: Json | null
          guild_id?: string
          id?: number
          resource_id?: string | null
          resource_type?: string | null
          user_id?: string
          user_tag?: string | null
        }
        Relationships: []
      }
      auth: {
        Row: {
          active: boolean
          email: string
          id: string
          password: string
        }
        Insert: {
          active: boolean
          email: string
          id: string
          password: string
        }
        Update: {
          active?: boolean
          email?: string
          id?: string
          password?: string
        }
        Relationships: []
      }
      auth_logs: {
        Row: {
          created_at: string
          event_type: string
          id: string
          ip_address: unknown
          metadata: Json | null
          user_agent: string | null
          user_id: string | null
        }
        Insert: {
          created_at?: string
          event_type: string
          id?: string
          ip_address?: unknown
          metadata?: Json | null
          user_agent?: string | null
          user_id?: string | null
        }
        Update: {
          created_at?: string
          event_type?: string
          id?: string
          ip_address?: unknown
          metadata?: Json | null
          user_agent?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      auth_nonces: {
        Row: {
          created_at: string | null
          expires_at: string
          id: number
          ip_address: unknown
          nonce: string
          used: boolean | null
          wallet_address: string
        }
        Insert: {
          created_at?: string | null
          expires_at: string
          id?: number
          ip_address?: unknown
          nonce: string
          used?: boolean | null
          wallet_address: string
        }
        Update: {
          created_at?: string | null
          expires_at?: string
          id?: number
          ip_address?: unknown
          nonce?: string
          used?: boolean | null
          wallet_address?: string
        }
        Relationships: []
      }
      automod_config: {
        Row: {
          badwords: Json | null
          exempt_roles: Json | null
          guild_id: string
          invites_enabled: boolean | null
          links_action: string | null
          links_enabled: boolean | null
          mentions_enabled: boolean | null
          mentions_limit: number | null
          spam_enabled: boolean | null
          spam_threshold: number | null
          updated_at: string | null
        }
        Insert: {
          badwords?: Json | null
          exempt_roles?: Json | null
          guild_id: string
          invites_enabled?: boolean | null
          links_action?: string | null
          links_enabled?: boolean | null
          mentions_enabled?: boolean | null
          mentions_limit?: number | null
          spam_enabled?: boolean | null
          spam_threshold?: number | null
          updated_at?: string | null
        }
        Update: {
          badwords?: Json | null
          exempt_roles?: Json | null
          guild_id?: string
          invites_enabled?: boolean | null
          links_action?: string | null
          links_enabled?: boolean | null
          mentions_enabled?: boolean | null
          mentions_limit?: number | null
          spam_enabled?: boolean | null
          spam_threshold?: number | null
          updated_at?: string | null
        }
        Relationships: []
      }
      backup_settings: {
        Row: {
          auto_backup: boolean | null
          backup_interval: number | null
          created_at: string | null
          guild_id: string
          id: number
          last_backup_at: string | null
          max_backups: number | null
        }
        Insert: {
          auto_backup?: boolean | null
          backup_interval?: number | null
          created_at?: string | null
          guild_id: string
          id?: number
          last_backup_at?: string | null
          max_backups?: number | null
        }
        Update: {
          auto_backup?: boolean | null
          backup_interval?: number | null
          created_at?: string | null
          guild_id?: string
          id?: number
          last_backup_at?: string | null
          max_backups?: number | null
        }
        Relationships: []
      }
      badges: {
        Row: {
          created_at: string | null
          description: string | null
          icon: string | null
          id: string
          name: string
          slug: string
          unlock_criteria: string | null
          unlocks_persona: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          icon?: string | null
          id?: string
          name: string
          slug: string
          unlock_criteria?: string | null
          unlocks_persona?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          icon?: string | null
          id?: string
          name?: string
          slug?: string
          unlock_criteria?: string | null
          unlocks_persona?: string | null
        }
        Relationships: []
      }
      blockchain_domains: {
        Row: {
          auto_renew: boolean | null
          created_at: string | null
          domain: string
          expires_at: string | null
          id: string
          marketplace_listed: boolean | null
          marketplace_price_usd: number | null
          nft_token_id: string | null
          owner_user_id: string
          renewal_price_usd: number | null
          updated_at: string | null
          verification_signature: string | null
          verified: boolean | null
          wallet_address: string | null
        }
        Insert: {
          auto_renew?: boolean | null
          created_at?: string | null
          domain: string
          expires_at?: string | null
          id?: string
          marketplace_listed?: boolean | null
          marketplace_price_usd?: number | null
          nft_token_id?: string | null
          owner_user_id: string
          renewal_price_usd?: number | null
          updated_at?: string | null
          verification_signature?: string | null
          verified?: boolean | null
          wallet_address?: string | null
        }
        Update: {
          auto_renew?: boolean | null
          created_at?: string | null
          domain?: string
          expires_at?: string | null
          id?: string
          marketplace_listed?: boolean | null
          marketplace_price_usd?: number | null
          nft_token_id?: string | null
          owner_user_id?: string
          renewal_price_usd?: number | null
          updated_at?: string | null
          verification_signature?: string | null
          verified?: boolean | null
          wallet_address?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "blockchain_domains_owner_user_id_fkey"
            columns: ["owner_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      blockchain_transactions: {
        Row: {
          block_number: number
          chain_id: number
          created_at: string | null
          from_address: string
          gas_price: number | null
          gas_used: number | null
          id: number
          metadata: Json | null
          status: string | null
          timestamp: string
          to_address: string | null
          transaction_hash: string
          transaction_type: string | null
          value: number | null
          value_currency: string | null
        }
        Insert: {
          block_number: number
          chain_id: number
          created_at?: string | null
          from_address: string
          gas_price?: number | null
          gas_used?: number | null
          id?: number
          metadata?: Json | null
          status?: string | null
          timestamp: string
          to_address?: string | null
          transaction_hash: string
          transaction_type?: string | null
          value?: number | null
          value_currency?: string | null
        }
        Update: {
          block_number?: number
          chain_id?: number
          created_at?: string | null
          from_address?: string
          gas_price?: number | null
          gas_used?: number | null
          id?: number
          metadata?: Json | null
          status?: string | null
          timestamp?: string
          to_address?: string | null
          transaction_hash?: string
          transaction_type?: string | null
          value?: number | null
          value_currency?: string | null
        }
        Relationships: []
      }
      blog_categories: {
        Row: {
          border_color: string
          created_at: string | null
          description: string | null
          id: string
          name: string
          slug: string
          theme: string
        }
        Insert: {
          border_color: string
          created_at?: string | null
          description?: string | null
          id: string
          name: string
          slug: string
          theme: string
        }
        Update: {
          border_color?: string
          created_at?: string | null
          description?: string | null
          id?: string
          name?: string
          slug?: string
          theme?: string
        }
        Relationships: []
      }
      blog_comments: {
        Row: {
          content: string
          created_at: string
          id: string
          parent_comment_id: string | null
          post_id: string
          updated_at: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          parent_comment_id?: string | null
          post_id: string
          updated_at?: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          parent_comment_id?: string | null
          post_id?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "blog_comments_parent_comment_id_fkey"
            columns: ["parent_comment_id"]
            isOneToOne: false
            referencedRelation: "blog_comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "blog_comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "blog_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "blog_comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      blog_post_likes: {
        Row: {
          created_at: string
          post_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          post_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "blog_post_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "blog_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "blog_post_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      blog_posts: {
        Row: {
          author: string | null
          author_id: string | null
          body_html: string | null
          category: string | null
          comments: number | null
          content: string | null
          created_at: string
          date: string | null
          excerpt: string | null
          id: string
          image: string | null
          image_prompt: string | null
          image_url: string | null
          likes: number | null
          published_at: string | null
          read_time: string | null
          slug: string
          status: string | null
          tags: string[] | null
          title: string
          updated_at: string
        }
        Insert: {
          author?: string | null
          author_id?: string | null
          body_html?: string | null
          category?: string | null
          comments?: number | null
          content?: string | null
          created_at?: string
          date?: string | null
          excerpt?: string | null
          id?: string
          image?: string | null
          image_prompt?: string | null
          image_url?: string | null
          likes?: number | null
          published_at?: string | null
          read_time?: string | null
          slug: string
          status?: string | null
          tags?: string[] | null
          title: string
          updated_at?: string
        }
        Update: {
          author?: string | null
          author_id?: string | null
          body_html?: string | null
          category?: string | null
          comments?: number | null
          content?: string | null
          created_at?: string
          date?: string | null
          excerpt?: string | null
          id?: string
          image?: string | null
          image_prompt?: string | null
          image_url?: string | null
          likes?: number | null
          published_at?: string | null
          read_time?: string | null
          slug?: string
          status?: string | null
          tags?: string[] | null
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "blog_posts_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      books: {
        Row: {
          category: string | null
          content: string | null
          created_at: string
          description: string | null
          display_order: number | null
          id: string
          image_prompt: string | null
          image_url: string | null
          is_free: boolean | null
          long_description: string | null
          purchase_links: Json | null
          rating: number | null
          release_date: string | null
          site_id: string
          tags: string[] | null
          title: string
        }
        Insert: {
          category?: string | null
          content?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          is_free?: boolean | null
          long_description?: string | null
          purchase_links?: Json | null
          rating?: number | null
          release_date?: string | null
          site_id: string
          tags?: string[] | null
          title: string
        }
        Update: {
          category?: string | null
          content?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          is_free?: boolean | null
          long_description?: string | null
          purchase_links?: Json | null
          rating?: number | null
          release_date?: string | null
          site_id?: string
          tags?: string[] | null
          title?: string
        }
        Relationships: []
      }
      bounties: {
        Row: {
          applicant_count: number | null
          bounty_id: string
          claimed_at: string | null
          claimed_by: string | null
          created_at: string | null
          description: string
          difficulty: string | null
          id: string
          posted_by: string | null
          project: string | null
          reward_usd: number
          skills: string[] | null
          status: string | null
          submission_notes: string | null
          submission_url: string | null
          submitted_at: string | null
          time_estimate: string | null
          title: string
          updated_at: string | null
          xp_reward: number | null
        }
        Insert: {
          applicant_count?: number | null
          bounty_id: string
          claimed_at?: string | null
          claimed_by?: string | null
          created_at?: string | null
          description: string
          difficulty?: string | null
          id?: string
          posted_by?: string | null
          project?: string | null
          reward_usd: number
          skills?: string[] | null
          status?: string | null
          submission_notes?: string | null
          submission_url?: string | null
          submitted_at?: string | null
          time_estimate?: string | null
          title: string
          updated_at?: string | null
          xp_reward?: number | null
        }
        Update: {
          applicant_count?: number | null
          bounty_id?: string
          claimed_at?: string | null
          claimed_by?: string | null
          created_at?: string | null
          description?: string
          difficulty?: string | null
          id?: string
          posted_by?: string | null
          project?: string | null
          reward_usd?: number
          skills?: string[] | null
          status?: string | null
          submission_notes?: string | null
          submission_url?: string | null
          submitted_at?: string | null
          time_estimate?: string | null
          title?: string
          updated_at?: string | null
          xp_reward?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "bounties_claimed_by_fkey"
            columns: ["claimed_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bounties_posted_by_fkey"
            columns: ["posted_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      bounty_applications: {
        Row: {
          bounty_id: string | null
          created_at: string | null
          id: string
          message: string
          status: string | null
          user_id: string | null
        }
        Insert: {
          bounty_id?: string | null
          created_at?: string | null
          id?: string
          message: string
          status?: string | null
          user_id?: string | null
        }
        Update: {
          bounty_id?: string | null
          created_at?: string | null
          id?: string
          message?: string
          status?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "bounty_applications_bounty_id_fkey"
            columns: ["bounty_id"]
            isOneToOne: false
            referencedRelation: "bounties"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bounty_applications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      bounty_claims: {
        Row: {
          bounty_id: string
          claimed_at: string
          grid_member_id: string
          id: string
          status: string
          submitted_at: string | null
          updated_at: string | null
        }
        Insert: {
          bounty_id: string
          claimed_at?: string
          grid_member_id: string
          id?: string
          status?: string
          submitted_at?: string | null
          updated_at?: string | null
        }
        Update: {
          bounty_id?: string
          claimed_at?: string
          grid_member_id?: string
          id?: string
          status?: string
          submitted_at?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "bounty_claims_bounty_id_fkey"
            columns: ["bounty_id"]
            isOneToOne: false
            referencedRelation: "bounties"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "bounty_claims_grid_member_id_fkey"
            columns: ["grid_member_id"]
            isOneToOne: false
            referencedRelation: "grid_members"
            referencedColumns: ["id"]
          },
        ]
      }
      branding_analytics: {
        Row: {
          created_at: string | null
          event_type: string
          guild_id: string
          id: number
          ip_hash: string | null
          metadata: Json | null
          referrer: string | null
          user_agent: string | null
        }
        Insert: {
          created_at?: string | null
          event_type: string
          guild_id: string
          id?: number
          ip_hash?: string | null
          metadata?: Json | null
          referrer?: string | null
          user_agent?: string | null
        }
        Update: {
          created_at?: string | null
          event_type?: string
          guild_id?: string
          id?: number
          ip_hash?: string | null
          metadata?: Json | null
          referrer?: string | null
          user_agent?: string | null
        }
        Relationships: []
      }
      call_participants: {
        Row: {
          call_id: string
          connection_quality: string | null
          created_at: string | null
          id: string
          joined_at: string | null
          left_at: string | null
          media_state: Json | null
          user_id: string
        }
        Insert: {
          call_id: string
          connection_quality?: string | null
          created_at?: string | null
          id?: string
          joined_at?: string | null
          left_at?: string | null
          media_state?: Json | null
          user_id: string
        }
        Update: {
          call_id?: string
          connection_quality?: string | null
          created_at?: string | null
          id?: string
          joined_at?: string | null
          left_at?: string | null
          media_state?: Json | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "call_participants_call_id_fkey"
            columns: ["call_id"]
            isOneToOne: false
            referencedRelation: "calls"
            referencedColumns: ["id"]
          },
        ]
      }
      calls: {
        Row: {
          conversation_id: string
          created_at: string | null
          duration_seconds: number | null
          end_reason: string | null
          ended_at: string | null
          id: string
          initiator_id: string
          metadata: Json | null
          sfu_room_id: string | null
          started_at: string | null
          status: string
          type: string
        }
        Insert: {
          conversation_id: string
          created_at?: string | null
          duration_seconds?: number | null
          end_reason?: string | null
          ended_at?: string | null
          id?: string
          initiator_id: string
          metadata?: Json | null
          sfu_room_id?: string | null
          started_at?: string | null
          status?: string
          type: string
        }
        Update: {
          conversation_id?: string
          created_at?: string | null
          duration_seconds?: number | null
          end_reason?: string | null
          ended_at?: string | null
          id?: string
          initiator_id?: string
          metadata?: Json | null
          sfu_room_id?: string | null
          started_at?: string | null
          status?: string
          type?: string
        }
        Relationships: [
          {
            foreignKeyName: "calls_conversation_id_fkey"
            columns: ["conversation_id"]
            isOneToOne: false
            referencedRelation: "conversations"
            referencedColumns: ["id"]
          },
        ]
      }
      changelogs: {
        Row: {
          changes: Json
          created_at: string | null
          id: string
          site_id: string | null
          site_name: string | null
          tags: Json | null
          title: string
          version_date: string
        }
        Insert: {
          changes: Json
          created_at?: string | null
          id?: string
          site_id?: string | null
          site_name?: string | null
          tags?: Json | null
          title: string
          version_date: string
        }
        Update: {
          changes?: Json
          created_at?: string | null
          id?: string
          site_id?: string | null
          site_name?: string | null
          tags?: Json | null
          title?: string
          version_date?: string
        }
        Relationships: [
          {
            foreignKeyName: "changelogs_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "changelogs_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      channel: {
        Row: {
          archived_at: number | null
          archived_by: string | null
          created_at: number | null
          data: Json | null
          deleted_at: number | null
          deleted_by: string | null
          description: string | null
          id: string
          is_private: boolean | null
          meta: Json | null
          name: string | null
          type: string | null
          updated_at: number | null
          updated_by: string | null
          user_id: string | null
        }
        Insert: {
          archived_at?: number | null
          archived_by?: string | null
          created_at?: number | null
          data?: Json | null
          deleted_at?: number | null
          deleted_by?: string | null
          description?: string | null
          id: string
          is_private?: boolean | null
          meta?: Json | null
          name?: string | null
          type?: string | null
          updated_at?: number | null
          updated_by?: string | null
          user_id?: string | null
        }
        Update: {
          archived_at?: number | null
          archived_by?: string | null
          created_at?: number | null
          data?: Json | null
          deleted_at?: number | null
          deleted_by?: string | null
          description?: string | null
          id?: string
          is_private?: boolean | null
          meta?: Json | null
          name?: string | null
          type?: string | null
          updated_at?: number | null
          updated_by?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      channel_file: {
        Row: {
          channel_id: string
          created_at: number
          file_id: string
          id: string
          message_id: string | null
          updated_at: number
          user_id: string
        }
        Insert: {
          channel_id: string
          created_at: number
          file_id: string
          id: string
          message_id?: string | null
          updated_at: number
          user_id: string
        }
        Update: {
          channel_id?: string
          created_at?: number
          file_id?: string
          id?: string
          message_id?: string | null
          updated_at?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "channel_file_channel_id_fkey"
            columns: ["channel_id"]
            isOneToOne: false
            referencedRelation: "channel"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "channel_file_file_id_fkey"
            columns: ["file_id"]
            isOneToOne: false
            referencedRelation: "file"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_channel_file_message_id"
            columns: ["message_id"]
            isOneToOne: false
            referencedRelation: "message"
            referencedColumns: ["id"]
          },
        ]
      }
      channel_member: {
        Row: {
          channel_id: string
          created_at: number | null
          data: Json | null
          id: string
          invited_at: number | null
          invited_by: string | null
          is_active: boolean
          is_channel_muted: boolean
          is_channel_pinned: boolean
          joined_at: number
          last_read_at: number | null
          left_at: number | null
          meta: Json | null
          role: string | null
          status: string | null
          updated_at: number | null
          user_id: string
        }
        Insert: {
          channel_id: string
          created_at?: number | null
          data?: Json | null
          id: string
          invited_at?: number | null
          invited_by?: string | null
          is_active?: boolean
          is_channel_muted?: boolean
          is_channel_pinned?: boolean
          joined_at: number
          last_read_at?: number | null
          left_at?: number | null
          meta?: Json | null
          role?: string | null
          status?: string | null
          updated_at?: number | null
          user_id: string
        }
        Update: {
          channel_id?: string
          created_at?: number | null
          data?: Json | null
          id?: string
          invited_at?: number | null
          invited_by?: string | null
          is_active?: boolean
          is_channel_muted?: boolean
          is_channel_pinned?: boolean
          joined_at?: number
          last_read_at?: number | null
          left_at?: number | null
          meta?: Json | null
          role?: string | null
          status?: string | null
          updated_at?: number | null
          user_id?: string
        }
        Relationships: []
      }
      channel_webhook: {
        Row: {
          channel_id: string
          created_at: number
          id: string
          last_used_at: number | null
          name: string
          profile_image_url: string | null
          token: string
          updated_at: number
          user_id: string
        }
        Insert: {
          channel_id: string
          created_at: number
          id: string
          last_used_at?: number | null
          name: string
          profile_image_url?: string | null
          token: string
          updated_at: number
          user_id: string
        }
        Update: {
          channel_id?: string
          created_at?: number
          id?: string
          last_used_at?: number | null
          name?: string
          profile_image_url?: string | null
          token?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "channel_webhook_channel_id_fkey"
            columns: ["channel_id"]
            isOneToOne: false
            referencedRelation: "channel"
            referencedColumns: ["id"]
          },
        ]
      }
      channels: {
        Row: {
          channel_type: string | null
          created_at: string | null
          description: string | null
          id: string
          is_private: boolean | null
          name: string
          position: number | null
          server_id: string | null
          slowmode_seconds: number | null
          type: string | null
          updated_at: string | null
        }
        Insert: {
          channel_type?: string | null
          created_at?: string | null
          description?: string | null
          id: string
          is_private?: boolean | null
          name: string
          position?: number | null
          server_id?: string | null
          slowmode_seconds?: number | null
          type?: string | null
          updated_at?: string | null
        }
        Update: {
          channel_type?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          is_private?: boolean | null
          name?: string
          position?: number | null
          server_id?: string | null
          slowmode_seconds?: number | null
          type?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "channels_server_id_fkey"
            columns: ["server_id"]
            isOneToOne: false
            referencedRelation: "servers"
            referencedColumns: ["id"]
          },
        ]
      }
      chat: {
        Row: {
          archived: boolean
          chat: Json | null
          created_at: number
          folder_id: string | null
          id: string
          meta: Json
          pinned: boolean | null
          share_id: string | null
          title: string
          updated_at: number
          user_id: string
        }
        Insert: {
          archived: boolean
          chat?: Json | null
          created_at: number
          folder_id?: string | null
          id: string
          meta?: Json
          pinned?: boolean | null
          share_id?: string | null
          title: string
          updated_at: number
          user_id: string
        }
        Update: {
          archived?: boolean
          chat?: Json | null
          created_at?: number
          folder_id?: string | null
          id?: string
          meta?: Json
          pinned?: boolean | null
          share_id?: string | null
          title?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: []
      }
      chat_file: {
        Row: {
          chat_id: string
          created_at: number
          file_id: string
          id: string
          message_id: string | null
          updated_at: number
          user_id: string
        }
        Insert: {
          chat_id: string
          created_at: number
          file_id: string
          id: string
          message_id?: string | null
          updated_at: number
          user_id: string
        }
        Update: {
          chat_id?: string
          created_at?: number
          file_id?: string
          id?: string
          message_id?: string | null
          updated_at?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "chat_file_chat_id_fkey"
            columns: ["chat_id"]
            isOneToOne: false
            referencedRelation: "chat"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "chat_file_file_id_fkey"
            columns: ["file_id"]
            isOneToOne: false
            referencedRelation: "file"
            referencedColumns: ["id"]
          },
        ]
      }
      chat_message: {
        Row: {
          chat_id: string
          content: Json | null
          created_at: number | null
          done: boolean | null
          embeds: Json | null
          error: Json | null
          files: Json | null
          id: string
          model_id: string | null
          output: Json | null
          parent_id: string | null
          role: string
          sources: Json | null
          status_history: Json | null
          updated_at: number | null
          usage: Json | null
          user_id: string | null
        }
        Insert: {
          chat_id: string
          content?: Json | null
          created_at?: number | null
          done?: boolean | null
          embeds?: Json | null
          error?: Json | null
          files?: Json | null
          id: string
          model_id?: string | null
          output?: Json | null
          parent_id?: string | null
          role: string
          sources?: Json | null
          status_history?: Json | null
          updated_at?: number | null
          usage?: Json | null
          user_id?: string | null
        }
        Update: {
          chat_id?: string
          content?: Json | null
          created_at?: number | null
          done?: boolean | null
          embeds?: Json | null
          error?: Json | null
          files?: Json | null
          id?: string
          model_id?: string | null
          output?: Json | null
          parent_id?: string | null
          role?: string
          sources?: Json | null
          status_history?: Json | null
          updated_at?: number | null
          usage?: Json | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "chat_message_chat_id_fkey"
            columns: ["chat_id"]
            isOneToOne: false
            referencedRelation: "chat"
            referencedColumns: ["id"]
          },
        ]
      }
      chatidtag: {
        Row: {
          chat_id: string
          id: string
          tag_name: string
          timestamp: number
          user_id: string
        }
        Insert: {
          chat_id: string
          id: string
          tag_name: string
          timestamp: number
          user_id: string
        }
        Update: {
          chat_id?: string
          id?: string
          tag_name?: string
          timestamp?: number
          user_id?: string
        }
        Relationships: []
      }
      cloud_saves: {
        Row: {
          cloud_size: number | null
          cloud_timestamp: string | null
          created_at: string | null
          game_id: string
          game_name: string
          id: string
          last_sync: string | null
          local_size: number | null
          local_timestamp: string | null
          save_name: string | null
          status: string | null
          user_id: string
        }
        Insert: {
          cloud_size?: number | null
          cloud_timestamp?: string | null
          created_at?: string | null
          game_id: string
          game_name: string
          id?: string
          last_sync?: string | null
          local_size?: number | null
          local_timestamp?: string | null
          save_name?: string | null
          status?: string | null
          user_id: string
        }
        Update: {
          cloud_size?: number | null
          cloud_timestamp?: string | null
          created_at?: string | null
          game_id?: string
          game_name?: string
          id?: string
          last_sync?: string | null
          local_size?: number | null
          local_timestamp?: string | null
          save_name?: string | null
          status?: string | null
          user_id?: string
        }
        Relationships: []
      }
      code_gallery: {
        Row: {
          category: string | null
          code: string
          created_at: string | null
          creator_id: string
          description: string | null
          id: string
          is_public: boolean | null
          language: string
          likes: number | null
          tags: Json | null
          title: string
          updated_at: string | null
          views: number | null
        }
        Insert: {
          category?: string | null
          code: string
          created_at?: string | null
          creator_id: string
          description?: string | null
          id: string
          is_public?: boolean | null
          language: string
          likes?: number | null
          tags?: Json | null
          title: string
          updated_at?: string | null
          views?: number | null
        }
        Update: {
          category?: string | null
          code?: string
          created_at?: string | null
          creator_id?: string
          description?: string | null
          id?: string
          is_public?: boolean | null
          language?: string
          likes?: number | null
          tags?: Json | null
          title?: string
          updated_at?: string | null
          views?: number | null
        }
        Relationships: []
      }
      collaboration_comments: {
        Row: {
          content: string
          created_at: string
          id: string
          post_id: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          post_id: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "collaboration_comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "collaboration_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "collaboration_comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      collaboration_post_likes: {
        Row: {
          created_at: string
          post_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          post_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "collaboration_post_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "collaboration_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "collaboration_post_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      collaboration_posts: {
        Row: {
          arm_affiliation: string
          category: string | null
          comments_count: number | null
          content: string
          created_at: string
          created_by: string
          id: string
          is_published: boolean | null
          likes_count: number | null
          tags: string[] | null
          title: string
          updated_at: string
        }
        Insert: {
          arm_affiliation?: string
          category?: string | null
          comments_count?: number | null
          content: string
          created_at?: string
          created_by: string
          id?: string
          is_published?: boolean | null
          likes_count?: number | null
          tags?: string[] | null
          title: string
          updated_at?: string
        }
        Update: {
          arm_affiliation?: string
          category?: string | null
          comments_count?: number | null
          content?: string
          created_at?: string
          created_by?: string
          id?: string
          is_published?: boolean | null
          likes_count?: number | null
          tags?: string[] | null
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "collaboration_posts_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      collaboration_posts_authors: {
        Row: {
          collaboration_post_id: string
          id: string
          joined_at: string
          role: string
          user_id: string
        }
        Insert: {
          collaboration_post_id: string
          id?: string
          joined_at?: string
          role?: string
          user_id: string
        }
        Update: {
          collaboration_post_id?: string
          id?: string
          joined_at?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "collaboration_posts_authors_collaboration_post_id_fkey"
            columns: ["collaboration_post_id"]
            isOneToOne: false
            referencedRelation: "collaboration_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "collaboration_posts_authors_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      command_cooldowns: {
        Row: {
          command: string
          expires_at: string
          guild_id: string
          id: number
          user_id: string
        }
        Insert: {
          command: string
          expires_at: string
          guild_id: string
          id?: number
          user_id: string
        }
        Update: {
          command?: string
          expires_at?: string
          guild_id?: string
          id?: number
          user_id?: string
        }
        Relationships: []
      }
      command_logs: {
        Row: {
          command: string
          created_at: string | null
          guild_id: string
          id: number
          options: Json | null
          user_id: string
        }
        Insert: {
          command: string
          created_at?: string | null
          guild_id: string
          id?: number
          options?: Json | null
          user_id: string
        }
        Update: {
          command?: string
          created_at?: string | null
          guild_id?: string
          id?: number
          options?: Json | null
          user_id?: string
        }
        Relationships: []
      }
      comments: {
        Row: {
          content: string
          created_at: string
          id: string
          parent_comment_id: string | null
          post_id: string
          updated_at: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          parent_comment_id?: string | null
          post_id: string
          updated_at?: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          parent_comment_id?: string | null
          post_id?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "comments_parent_comment_id_fkey"
            columns: ["parent_comment_id"]
            isOneToOne: false
            referencedRelation: "comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      community_comments: {
        Row: {
          content: string
          created_at: string
          id: string
          post_id: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          post_id: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "community_comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "community_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "community_comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      community_contributors: {
        Row: {
          avatar_url: string | null
          contribution_count: number | null
          contributions_json: Json | null
          created_at: string
          discord_id: string | null
          display_name: string
          display_rank: number | null
          github_username: string | null
          highlight_text: string | null
          id: string
          is_spotlight: boolean | null
          tagline: string | null
          twitter_handle: string | null
          updated_at: string
          user_id: string | null
        }
        Insert: {
          avatar_url?: string | null
          contribution_count?: number | null
          contributions_json?: Json | null
          created_at?: string
          discord_id?: string | null
          display_name: string
          display_rank?: number | null
          github_username?: string | null
          highlight_text?: string | null
          id?: string
          is_spotlight?: boolean | null
          tagline?: string | null
          twitter_handle?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Update: {
          avatar_url?: string | null
          contribution_count?: number | null
          contributions_json?: Json | null
          created_at?: string
          discord_id?: string | null
          display_name?: string
          display_rank?: number | null
          github_username?: string | null
          highlight_text?: string | null
          id?: string
          is_spotlight?: boolean | null
          tagline?: string | null
          twitter_handle?: string | null
          updated_at?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "community_contributors_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      community_likes: {
        Row: {
          created_at: string | null
          id: number
          liker_id: string
          post_id: string
        }
        Insert: {
          created_at?: string | null
          id?: number
          liker_id: string
          post_id: string
        }
        Update: {
          created_at?: string | null
          id?: number
          liker_id?: string
          post_id?: string
        }
        Relationships: []
      }
      community_notifications: {
        Row: {
          actor_id: string
          collaboration_post_id: string | null
          created_at: string
          description: string | null
          id: string
          notification_type: string
          post_id: string | null
          read: boolean | null
          title: string
          user_id: string
        }
        Insert: {
          actor_id: string
          collaboration_post_id?: string | null
          created_at?: string
          description?: string | null
          id?: string
          notification_type: string
          post_id?: string | null
          read?: boolean | null
          title: string
          user_id: string
        }
        Update: {
          actor_id?: string
          collaboration_post_id?: string | null
          created_at?: string
          description?: string | null
          id?: string
          notification_type?: string
          post_id?: string | null
          read?: boolean | null
          title?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "community_notifications_actor_id_fkey"
            columns: ["actor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "community_notifications_collaboration_post_id_fkey"
            columns: ["collaboration_post_id"]
            isOneToOne: false
            referencedRelation: "collaboration_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "community_notifications_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "community_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "community_notifications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      community_post_likes: {
        Row: {
          created_at: string
          post_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          post_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "community_post_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "community_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "community_post_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      community_posts: {
        Row: {
          arm_affiliation: string | null
          author_id: string | null
          category: string | null
          comments_count: number | null
          content: string
          created_at: string | null
          id: string
          is_published: boolean | null
          likes_count: number | null
          tags: string[] | null
          title: string
          updated_at: string | null
        }
        Insert: {
          arm_affiliation?: string | null
          author_id?: string | null
          category?: string | null
          comments_count?: number | null
          content: string
          created_at?: string | null
          id?: string
          is_published?: boolean | null
          likes_count?: number | null
          tags?: string[] | null
          title: string
          updated_at?: string | null
        }
        Update: {
          arm_affiliation?: string | null
          author_id?: string | null
          category?: string | null
          comments_count?: number | null
          content?: string
          created_at?: string | null
          id?: string
          is_published?: boolean | null
          likes_count?: number | null
          tags?: string[] | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "community_posts_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      company_documents: {
        Row: {
          category: string | null
          created_at: string | null
          description: string | null
          file_url: string | null
          id: string
          site_id: string
          title: string
          updated_at: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          file_url?: string | null
          id?: string
          site_id: string
          title: string
          updated_at?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string | null
          description?: string | null
          file_url?: string | null
          id?: string
          site_id?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "company_documents_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "company_documents_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      config: {
        Row: {
          created_at: string
          data: Json
          id: number
          updated_at: string | null
          version: number
        }
        Insert: {
          created_at?: string
          data: Json
          id?: number
          updated_at?: string | null
          version: number
        }
        Update: {
          created_at?: string
          data?: Json
          id?: number
          updated_at?: string | null
          version?: number
        }
        Relationships: []
      }
      connections: {
        Row: {
          bandwidth: number | null
          created_at: string | null
          directed: boolean | null
          from: string
          id: string
          status: string | null
          to: string
          updated_at: string | null
        }
        Insert: {
          bandwidth?: number | null
          created_at?: string | null
          directed?: boolean | null
          from: string
          id?: string
          status?: string | null
          to: string
          updated_at?: string | null
        }
        Update: {
          bandwidth?: number | null
          created_at?: string | null
          directed?: boolean | null
          from?: string
          id?: string
          status?: string | null
          to?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "connections_from_fkey"
            columns: ["from"]
            isOneToOne: false
            referencedRelation: "nodes"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "connections_to_fkey"
            columns: ["to"]
            isOneToOne: false
            referencedRelation: "nodes"
            referencedColumns: ["id"]
          },
        ]
      }
      consultancy_services: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          display_order: number | null
          features: string[]
          id: string
          is_featured: boolean
          long_description: string | null
          price: number
          price_description: string | null
          title: string
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          features: string[]
          id?: string
          is_featured?: boolean
          long_description?: string | null
          price: number
          price_description?: string | null
          title: string
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          features?: string[]
          id?: string
          is_featured?: boolean
          long_description?: string | null
          price?: number
          price_description?: string | null
          title?: string
        }
        Relationships: []
      }
      contact_submissions: {
        Row: {
          created_at: string
          email: string
          id: string
          message: string
          name: string
          subject: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          message: string
          name: string
          subject?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          message?: string
          name?: string
          subject?: string | null
        }
        Relationships: []
      }
      contracts: {
        Row: {
          created_at: string | null
          document_url: string | null
          id: string
          site_id: string
          status: string | null
          title: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          document_url?: string | null
          id?: string
          site_id: string
          status?: string | null
          title: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          document_url?: string | null
          id?: string
          site_id?: string
          status?: string | null
          title?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "contracts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "contracts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "contracts_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      conversation_participants: {
        Row: {
          conversation_id: string
          id: string
          identity_id: string | null
          joined_at: string | null
          last_read_at: string | null
          notification_settings: Json | null
          role: string | null
          user_id: string
        }
        Insert: {
          conversation_id: string
          id?: string
          identity_id?: string | null
          joined_at?: string | null
          last_read_at?: string | null
          notification_settings?: Json | null
          role?: string | null
          user_id: string
        }
        Update: {
          conversation_id?: string
          id?: string
          identity_id?: string | null
          joined_at?: string | null
          last_read_at?: string | null
          notification_settings?: Json | null
          role?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "conversation_participants_conversation_id_fkey"
            columns: ["conversation_id"]
            isOneToOne: false
            referencedRelation: "conversations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "conversation_participants_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      conversations: {
        Row: {
          avatar_url: string | null
          created_at: string
          created_by: string | null
          description: string | null
          gameforge_project_id: string | null
          id: string
          is_archived: boolean | null
          last_message_at: string
          metadata: Json | null
          participant_ids: string[]
          title: string | null
          type: string | null
          updated_at: string | null
        }
        Insert: {
          avatar_url?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          gameforge_project_id?: string | null
          id?: string
          is_archived?: boolean | null
          last_message_at?: string
          metadata?: Json | null
          participant_ids: string[]
          title?: string | null
          type?: string | null
          updated_at?: string | null
        }
        Update: {
          avatar_url?: string | null
          created_at?: string
          created_by?: string | null
          description?: string | null
          gameforge_project_id?: string | null
          id?: string
          is_archived?: boolean | null
          last_message_at?: string
          metadata?: Json | null
          participant_ids?: string[]
          title?: string | null
          type?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      corp_activity_log: {
        Row: {
          action: string
          actor_id: string
          company_id: string
          created_at: string
          id: string
          ip_address: string | null
          metadata: Json | null
          resource_id: string | null
          resource_type: string | null
          user_agent: string | null
        }
        Insert: {
          action: string
          actor_id: string
          company_id: string
          created_at?: string
          id?: string
          ip_address?: string | null
          metadata?: Json | null
          resource_id?: string | null
          resource_type?: string | null
          user_agent?: string | null
        }
        Update: {
          action?: string
          actor_id?: string
          company_id?: string
          created_at?: string
          id?: string
          ip_address?: string | null
          metadata?: Json | null
          resource_id?: string | null
          resource_type?: string | null
          user_agent?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "corp_activity_log_actor_id_fkey"
            columns: ["actor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corp_activity_log_company_id_fkey"
            columns: ["company_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_contract_milestones: {
        Row: {
          contract_id: string
          created_at: string
          deliverables: string | null
          description: string | null
          due_date: string | null
          id: string
          milestone_name: string
          status: string
          updated_at: string
        }
        Insert: {
          contract_id: string
          created_at?: string
          deliverables?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          milestone_name: string
          status?: string
          updated_at?: string
        }
        Update: {
          contract_id?: string
          created_at?: string
          deliverables?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          milestone_name?: string
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_contract_milestones_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "corp_contracts"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_contracts: {
        Row: {
          client_company_id: string
          contract_name: string
          contract_type: string
          contract_value: number | null
          created_at: string
          description: string | null
          document_url: string | null
          end_date: string | null
          id: string
          signed_at: string | null
          start_date: string | null
          status: string
          updated_at: string
          vendor_id: string
        }
        Insert: {
          client_company_id: string
          contract_name: string
          contract_type: string
          contract_value?: number | null
          created_at?: string
          description?: string | null
          document_url?: string | null
          end_date?: string | null
          id?: string
          signed_at?: string | null
          start_date?: string | null
          status?: string
          updated_at?: string
          vendor_id: string
        }
        Update: {
          client_company_id?: string
          contract_name?: string
          contract_type?: string
          contract_value?: number | null
          created_at?: string
          description?: string | null
          document_url?: string | null
          end_date?: string | null
          id?: string
          signed_at?: string | null
          start_date?: string | null
          status?: string
          updated_at?: string
          vendor_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_contracts_client_company_id_fkey"
            columns: ["client_company_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corp_contracts_vendor_id_fkey"
            columns: ["vendor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_financial_summary: {
        Row: {
          active_contracts: number | null
          average_payment_days: number | null
          company_id: string
          completed_contracts: number | null
          created_at: string
          id: string
          period_end: string
          period_start: string
          total_contract_value: number | null
          total_invoiced: number | null
          total_overdue: number | null
          total_paid: number | null
          updated_at: string
        }
        Insert: {
          active_contracts?: number | null
          average_payment_days?: number | null
          company_id: string
          completed_contracts?: number | null
          created_at?: string
          id?: string
          period_end: string
          period_start: string
          total_contract_value?: number | null
          total_invoiced?: number | null
          total_overdue?: number | null
          total_paid?: number | null
          updated_at?: string
        }
        Update: {
          active_contracts?: number | null
          average_payment_days?: number | null
          company_id?: string
          completed_contracts?: number | null
          created_at?: string
          id?: string
          period_end?: string
          period_start?: string
          total_contract_value?: number | null
          total_invoiced?: number | null
          total_overdue?: number | null
          total_paid?: number | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_financial_summary_company_id_fkey"
            columns: ["company_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_invoice_items: {
        Row: {
          amount: number
          category: string | null
          created_at: string
          description: string
          id: string
          invoice_id: string
          quantity: number
          unit_price: number
        }
        Insert: {
          amount: number
          category?: string | null
          created_at?: string
          description: string
          id?: string
          invoice_id: string
          quantity?: number
          unit_price: number
        }
        Update: {
          amount?: number
          category?: string | null
          created_at?: string
          description?: string
          id?: string
          invoice_id?: string
          quantity?: number
          unit_price?: number
        }
        Relationships: [
          {
            foreignKeyName: "corp_invoice_items_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "corp_invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_invoice_payments: {
        Row: {
          amount_paid: number
          created_at: string
          id: string
          invoice_id: string
          notes: string | null
          payment_date: string
          payment_method: string
          reference_number: string | null
        }
        Insert: {
          amount_paid: number
          created_at?: string
          id?: string
          invoice_id: string
          notes?: string | null
          payment_date?: string
          payment_method?: string
          reference_number?: string | null
        }
        Update: {
          amount_paid?: number
          created_at?: string
          id?: string
          invoice_id?: string
          notes?: string | null
          payment_date?: string
          payment_method?: string
          reference_number?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "corp_invoice_payments_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "corp_invoices"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_invoices: {
        Row: {
          amount_due: number
          amount_paid: number
          client_company_id: string
          created_at: string
          currency: string
          description: string | null
          due_date: string
          id: string
          invoice_number: string
          issue_date: string
          notes: string | null
          project_id: string | null
          status: string
          updated_at: string
        }
        Insert: {
          amount_due: number
          amount_paid?: number
          client_company_id: string
          created_at?: string
          currency?: string
          description?: string | null
          due_date: string
          id?: string
          invoice_number: string
          issue_date?: string
          notes?: string | null
          project_id?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          amount_due?: number
          amount_paid?: number
          client_company_id?: string
          created_at?: string
          currency?: string
          description?: string | null
          due_date?: string
          id?: string
          invoice_number?: string
          issue_date?: string
          notes?: string | null
          project_id?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_invoices_client_company_id_fkey"
            columns: ["client_company_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_projects: {
        Row: {
          budget: number | null
          client_company_id: string
          created_at: string
          description: string | null
          end_date: string | null
          id: string
          project_name: string
          spent: number | null
          start_date: string | null
          status: string
          updated_at: string
        }
        Insert: {
          budget?: number | null
          client_company_id: string
          created_at?: string
          description?: string | null
          end_date?: string | null
          id?: string
          project_name: string
          spent?: number | null
          start_date?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          budget?: number | null
          client_company_id?: string
          created_at?: string
          description?: string | null
          end_date?: string | null
          id?: string
          project_name?: string
          spent?: number | null
          start_date?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_projects_client_company_id_fkey"
            columns: ["client_company_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corp_team_members: {
        Row: {
          company_id: string
          created_at: string
          email: string
          full_name: string | null
          id: string
          invited_at: string | null
          job_title: string | null
          joined_at: string | null
          role: string
          status: string
          updated_at: string
          user_id: string
        }
        Insert: {
          company_id: string
          created_at?: string
          email: string
          full_name?: string | null
          id?: string
          invited_at?: string | null
          job_title?: string | null
          joined_at?: string | null
          role: string
          status?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          company_id?: string
          created_at?: string
          email?: string
          full_name?: string | null
          id?: string
          invited_at?: string | null
          job_title?: string | null
          joined_at?: string | null
          role?: string
          status?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "corp_team_members_company_id_fkey"
            columns: ["company_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corp_team_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      corporate_career_applications: {
        Row: {
          cover_letter: string | null
          email: string
          full_name: string
          id: string
          job_title: string
          portfolio_url: string | null
          submitted_at: string
        }
        Insert: {
          cover_letter?: string | null
          email: string
          full_name: string
          id?: string
          job_title: string
          portfolio_url?: string | null
          submitted_at?: string
        }
        Update: {
          cover_letter?: string | null
          email?: string
          full_name?: string
          id?: string
          job_title?: string
          portfolio_url?: string | null
          submitted_at?: string
        }
        Relationships: []
      }
      corporate_career_interest: {
        Row: {
          area_of_interest: string | null
          created_at: string
          email: string
          full_name: string
          id: string
          linkedin_url: string | null
          site_id: string
        }
        Insert: {
          area_of_interest?: string | null
          created_at?: string
          email: string
          full_name: string
          id?: string
          linkedin_url?: string | null
          site_id: string
        }
        Update: {
          area_of_interest?: string | null
          created_at?: string
          email?: string
          full_name?: string
          id?: string
          linkedin_url?: string | null
          site_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "corporate_career_interest_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_career_interest_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      corporate_investor_docs: {
        Row: {
          created_at: string | null
          description: string | null
          document_type: string | null
          file_url: string
          id: string
          published_date: string | null
          site_id: string
          title: string
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          document_type?: string | null
          file_url: string
          id?: string
          published_date?: string | null
          site_id: string
          title: string
        }
        Update: {
          created_at?: string | null
          description?: string | null
          document_type?: string | null
          file_url?: string
          id?: string
          published_date?: string | null
          site_id?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "corporate_investor_docs_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_investor_docs_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      corporate_job_postings: {
        Row: {
          created_at: string | null
          department: string | null
          description: string
          id: string
          is_active: boolean | null
          job_type: string | null
          location: string | null
          site_id: string
          title: string
        }
        Insert: {
          created_at?: string | null
          department?: string | null
          description: string
          id?: string
          is_active?: boolean | null
          job_type?: string | null
          location?: string | null
          site_id: string
          title: string
        }
        Update: {
          created_at?: string | null
          department?: string | null
          description?: string
          id?: string
          is_active?: boolean | null
          job_type?: string | null
          location?: string | null
          site_id?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "corporate_job_postings_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_job_postings_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      corporate_leadership: {
        Row: {
          bio: string | null
          created_at: string | null
          display_order: number | null
          id: string
          image_url: string | null
          name: string
          profile_id: string | null
          site_id: string
          social_links: Json | null
          title: string
        }
        Insert: {
          bio?: string | null
          created_at?: string | null
          display_order?: number | null
          id?: string
          image_url?: string | null
          name: string
          profile_id?: string | null
          site_id: string
          social_links?: Json | null
          title: string
        }
        Update: {
          bio?: string | null
          created_at?: string | null
          display_order?: number | null
          id?: string
          image_url?: string | null
          name?: string
          profile_id?: string | null
          site_id?: string
          social_links?: Json | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "corporate_leadership_profile_id_fkey"
            columns: ["profile_id"]
            isOneToOne: true
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_leadership_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_leadership_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      corporate_news: {
        Row: {
          author_id: string | null
          content: string
          created_at: string | null
          excerpt: string | null
          id: string
          image_url: string | null
          published_at: string | null
          site_id: string
          slug: string
          tags: string[] | null
          title: string
          updated_at: string | null
        }
        Insert: {
          author_id?: string | null
          content: string
          created_at?: string | null
          excerpt?: string | null
          id?: string
          image_url?: string | null
          published_at?: string | null
          site_id: string
          slug: string
          tags?: string[] | null
          title: string
          updated_at?: string | null
        }
        Update: {
          author_id?: string | null
          content?: string
          created_at?: string | null
          excerpt?: string | null
          id?: string
          image_url?: string | null
          published_at?: string | null
          site_id?: string
          slug?: string
          tags?: string[] | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "corporate_news_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_news_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_news_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      corporate_whitepapers: {
        Row: {
          created_at: string
          description: string | null
          file_url: string
          id: string
          image_url: string | null
          published_date: string | null
          site_id: string
          tags: string[] | null
          title: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          file_url: string
          id?: string
          image_url?: string | null
          published_date?: string | null
          site_id: string
          tags?: string[] | null
          title: string
        }
        Update: {
          created_at?: string
          description?: string | null
          file_url?: string
          id?: string
          image_url?: string | null
          published_date?: string | null
          site_id?: string
          tags?: string[] | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "corporate_whitepapers_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "corporate_whitepapers_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      courses: {
        Row: {
          category: string
          created_at: string | null
          description: string | null
          duration: string | null
          emoji: string | null
          id: string
          instructor: string | null
          is_featured: boolean | null
          is_published: boolean | null
          level: string | null
          long_description: string | null
          order_index: number | null
          slug: string
          thumbnail_url: string | null
          title: string
          total_lessons: number | null
          total_xp: number | null
          updated_at: string | null
        }
        Insert: {
          category: string
          created_at?: string | null
          description?: string | null
          duration?: string | null
          emoji?: string | null
          id?: string
          instructor?: string | null
          is_featured?: boolean | null
          is_published?: boolean | null
          level?: string | null
          long_description?: string | null
          order_index?: number | null
          slug: string
          thumbnail_url?: string | null
          title: string
          total_lessons?: number | null
          total_xp?: number | null
          updated_at?: string | null
        }
        Update: {
          category?: string
          created_at?: string | null
          description?: string | null
          duration?: string | null
          emoji?: string | null
          id?: string
          instructor?: string | null
          is_featured?: boolean | null
          is_published?: boolean | null
          level?: string | null
          long_description?: string | null
          order_index?: number | null
          slug?: string
          thumbnail_url?: string | null
          title?: string
          total_lessons?: number | null
          total_xp?: number | null
          updated_at?: string | null
        }
        Relationships: []
      }
      creations: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          display_order: number | null
          id: string
          image_prompt: string | null
          image_url: string | null
          links: Json | null
          site_id: string
          tags: string[] | null
          title: string
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          links?: Json | null
          site_id: string
          tags?: string[] | null
          title: string
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          links?: Json | null
          site_id?: string
          tags?: string[] | null
          title?: string
        }
        Relationships: []
      }
      creator_assets: {
        Row: {
          created_at: string
          description: string | null
          experience_id: string | null
          file_url: string
          id: string
          name: string
          thumbnail_url: string | null
          type: string
          updated_at: string
          user_id: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          experience_id?: string | null
          file_url: string
          id?: string
          name: string
          thumbnail_url?: string | null
          type: string
          updated_at?: string
          user_id: string
        }
        Update: {
          created_at?: string
          description?: string | null
          experience_id?: string | null
          file_url?: string
          id?: string
          name?: string
          thumbnail_url?: string | null
          type?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "creator_assets_experience_id_fkey"
            columns: ["experience_id"]
            isOneToOne: false
            referencedRelation: "experiences"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "creator_assets_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      creator_dashboard: {
        Row: {
          last_synced_at: string | null
          total_assets: number | null
          total_experiences: number | null
          total_projects: number | null
          user_id: string
        }
        Insert: {
          last_synced_at?: string | null
          total_assets?: number | null
          total_experiences?: number | null
          total_projects?: number | null
          user_id: string
        }
        Update: {
          last_synced_at?: string | null
          total_assets?: number | null
          total_experiences?: number | null
          total_projects?: number | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "creator_dashboard_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      custom_apps: {
        Row: {
          config: Json | null
          created_at: string | null
          creator_id: string
          description: string | null
          id: string
          install_count: number | null
          is_public: boolean | null
          name: string
          updated_at: string | null
        }
        Insert: {
          config?: Json | null
          created_at?: string | null
          creator_id: string
          description?: string | null
          id: string
          install_count?: number | null
          is_public?: boolean | null
          name: string
          updated_at?: string | null
        }
        Update: {
          config?: Json | null
          created_at?: string | null
          creator_id?: string
          description?: string | null
          id?: string
          install_count?: number | null
          is_public?: boolean | null
          name?: string
          updated_at?: string | null
        }
        Relationships: []
      }
      customers: {
        Row: {
          id: string
          stripe_customer_id: string | null
        }
        Insert: {
          id: string
          stripe_customer_id?: string | null
        }
        Update: {
          id?: string
          stripe_customer_id?: string | null
        }
        Relationships: []
      }
      daily_activity: {
        Row: {
          activity_date: string
          id: string
          lessons_completed: number | null
          time_spent_seconds: number | null
          user_id: string | null
          xp_earned: number | null
        }
        Insert: {
          activity_date: string
          id?: string
          lessons_completed?: number | null
          time_spent_seconds?: number | null
          user_id?: string | null
          xp_earned?: number | null
        }
        Update: {
          activity_date?: string
          id?: string
          lessons_completed?: number | null
          time_spent_seconds?: number | null
          user_id?: string | null
          xp_earned?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "daily_activity_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      daily_missions: {
        Row: {
          created_at: string
          description: string | null
          id: string
          is_active: boolean
          mission_date: string
          mission_type: string
          title: string
          xp_reward: number
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          mission_date?: string
          mission_type: string
          title: string
          xp_reward?: number
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          is_active?: boolean
          mission_date?: string
          mission_type?: string
          title?: string
          xp_reward?: number
        }
        Relationships: []
      }
      defi_positions: {
        Row: {
          amount: number
          amount_usd: number | null
          apy: number | null
          chain_id: number
          created_at: string | null
          id: number
          last_synced_at: string | null
          metadata: Json | null
          position_type: string
          protocol_name: string
          rewards_earned: number | null
          rewards_usd: number | null
          token_address: string | null
          token_symbol: string | null
          user_id: string
          wallet_address: string
        }
        Insert: {
          amount?: number
          amount_usd?: number | null
          apy?: number | null
          chain_id: number
          created_at?: string | null
          id?: number
          last_synced_at?: string | null
          metadata?: Json | null
          position_type: string
          protocol_name: string
          rewards_earned?: number | null
          rewards_usd?: number | null
          token_address?: string | null
          token_symbol?: string | null
          user_id: string
          wallet_address: string
        }
        Update: {
          amount?: number
          amount_usd?: number | null
          apy?: number | null
          chain_id?: number
          created_at?: string | null
          id?: number
          last_synced_at?: string | null
          metadata?: Json | null
          position_type?: string
          protocol_name?: string
          rewards_earned?: number | null
          rewards_usd?: number | null
          token_address?: string | null
          token_symbol?: string | null
          user_id?: string
          wallet_address?: string
        }
        Relationships: []
      }
      designer_waitlist: {
        Row: {
          created_at: string
          email: string
          id: string
          user_id: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          user_id?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          user_id?: string | null
        }
        Relationships: []
      }
      developer_api_keys: {
        Row: {
          created_at: string | null
          created_by_ip: string | null
          expires_at: string | null
          id: string
          is_active: boolean | null
          key_hash: string
          key_prefix: string
          last_used_at: string | null
          last_used_ip: string | null
          name: string
          rate_limit_per_day: number | null
          rate_limit_per_minute: number | null
          scopes: string[] | null
          usage_count: number | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          created_by_ip?: string | null
          expires_at?: string | null
          id?: string
          is_active?: boolean | null
          key_hash: string
          key_prefix: string
          last_used_at?: string | null
          last_used_ip?: string | null
          name: string
          rate_limit_per_day?: number | null
          rate_limit_per_minute?: number | null
          scopes?: string[] | null
          usage_count?: number | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          created_by_ip?: string | null
          expires_at?: string | null
          id?: string
          is_active?: boolean | null
          key_hash?: string
          key_prefix?: string
          last_used_at?: string | null
          last_used_ip?: string | null
          name?: string
          rate_limit_per_day?: number | null
          rate_limit_per_minute?: number | null
          scopes?: string[] | null
          usage_count?: number | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "developer_api_keys_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      developer_profiles: {
        Row: {
          company_name: string | null
          created_at: string | null
          github_username: string | null
          is_verified: boolean | null
          max_api_keys: number | null
          plan_ends_at: string | null
          plan_starts_at: string | null
          plan_tier: string | null
          rate_limit_multiplier: number | null
          updated_at: string | null
          user_id: string
          verified_at: string | null
          website_url: string | null
        }
        Insert: {
          company_name?: string | null
          created_at?: string | null
          github_username?: string | null
          is_verified?: boolean | null
          max_api_keys?: number | null
          plan_ends_at?: string | null
          plan_starts_at?: string | null
          plan_tier?: string | null
          rate_limit_multiplier?: number | null
          updated_at?: string | null
          user_id: string
          verified_at?: string | null
          website_url?: string | null
        }
        Update: {
          company_name?: string | null
          created_at?: string | null
          github_username?: string | null
          is_verified?: boolean | null
          max_api_keys?: number | null
          plan_ends_at?: string | null
          plan_starts_at?: string | null
          plan_tier?: string | null
          rate_limit_multiplier?: number | null
          updated_at?: string | null
          user_id?: string
          verified_at?: string | null
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "developer_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      developer_waitlist: {
        Row: {
          created_at: string
          email: string
          id: string
          user_id: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          user_id?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          user_id?: string | null
        }
        Relationships: []
      }
      developers: {
        Row: {
          avatar: string
          bio: string
          coordinates: Json
          created_at: string | null
          division: string
          email: string | null
          id: string
          location: string
          name: string
          projects: string[]
          role: string
          skills: string[]
          updated_at: string | null
        }
        Insert: {
          avatar: string
          bio: string
          coordinates: Json
          created_at?: string | null
          division: string
          email?: string | null
          id?: string
          location: string
          name: string
          projects?: string[]
          role: string
          skills?: string[]
          updated_at?: string | null
        }
        Update: {
          avatar?: string
          bio?: string
          coordinates?: Json
          created_at?: string | null
          division?: string
          email?: string | null
          id?: string
          location?: string
          name?: string
          projects?: string[]
          role?: string
          skills?: string[]
          updated_at?: string | null
        }
        Relationships: []
      }
      devhub_collaboration_sessions: {
        Row: {
          created_at: string | null
          ended_at: string | null
          id: string
          project_id: string | null
          site_id: string | null
          status: string | null
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          ended_at?: string | null
          id?: string
          project_id?: string | null
          site_id?: string | null
          status?: string | null
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          ended_at?: string | null
          id?: string
          project_id?: string | null
          site_id?: string | null
          status?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devhub_collaboration_sessions_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devhub_collaboration_sessions_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devhub_collaboration_sessions_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "devhub_collaboration_sessions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_achievements: {
        Row: {
          achievement_type: string
          badge_url: string | null
          description: string | null
          id: string
          title: string | null
          unlocked_at: string | null
          user_id: string | null
          xp_earned: number | null
        }
        Insert: {
          achievement_type: string
          badge_url?: string | null
          description?: string | null
          id?: string
          title?: string | null
          unlocked_at?: string | null
          user_id?: string | null
          xp_earned?: number | null
        }
        Update: {
          achievement_type?: string
          badge_url?: string | null
          description?: string | null
          id?: string
          title?: string | null
          unlocked_at?: string | null
          user_id?: string | null
          xp_earned?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_achievements_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_applications: {
        Row: {
          applicant_id: string | null
          availability_start_date: string | null
          categories: Json | null
          company_response: string | null
          company_response_date: string | null
          cover_letter: string | null
          created_date: string | null
          estimated_timeline: string | null
          id: string
          job_id: string | null
          portfolio_links: string[] | null
          proposed_rate: string | null
          rating: number | null
          review_text: string | null
          reviewed: boolean | null
          status: string | null
          updated_at: string | null
          would_work_again: boolean | null
        }
        Insert: {
          applicant_id?: string | null
          availability_start_date?: string | null
          categories?: Json | null
          company_response?: string | null
          company_response_date?: string | null
          cover_letter?: string | null
          created_date?: string | null
          estimated_timeline?: string | null
          id?: string
          job_id?: string | null
          portfolio_links?: string[] | null
          proposed_rate?: string | null
          rating?: number | null
          review_text?: string | null
          reviewed?: boolean | null
          status?: string | null
          updated_at?: string | null
          would_work_again?: boolean | null
        }
        Update: {
          applicant_id?: string | null
          availability_start_date?: string | null
          categories?: Json | null
          company_response?: string | null
          company_response_date?: string | null
          cover_letter?: string | null
          created_date?: string | null
          estimated_timeline?: string | null
          id?: string
          job_id?: string | null
          portfolio_links?: string[] | null
          proposed_rate?: string | null
          rating?: number | null
          review_text?: string | null
          reviewed?: boolean | null
          status?: string | null
          updated_at?: string | null
          would_work_again?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_applications_applicant_id_fkey"
            columns: ["applicant_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_applications_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_certifications: {
        Row: {
          certificate_url: string | null
          certification_level: string | null
          expiry_date: string | null
          id: string
          issued_date: string | null
          percentile: number | null
          score: number | null
          skill_name: string
          status: string | null
          user_id: string | null
          verification_code: string | null
          verified: boolean | null
        }
        Insert: {
          certificate_url?: string | null
          certification_level?: string | null
          expiry_date?: string | null
          id?: string
          issued_date?: string | null
          percentile?: number | null
          score?: number | null
          skill_name: string
          status?: string | null
          user_id?: string | null
          verification_code?: string | null
          verified?: boolean | null
        }
        Update: {
          certificate_url?: string | null
          certification_level?: string | null
          expiry_date?: string | null
          id?: string
          issued_date?: string | null
          percentile?: number | null
          score?: number | null
          skill_name?: string
          status?: string | null
          user_id?: string | null
          verification_code?: string | null
          verified?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_certifications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_collab_messages: {
        Row: {
          attachments: Json | null
          content: string | null
          created_date: string | null
          file_url: string | null
          id: string
          message_type: string | null
          read: boolean | null
          read_at: string | null
          room_id: string | null
          sender_id: string | null
        }
        Insert: {
          attachments?: Json | null
          content?: string | null
          created_date?: string | null
          file_url?: string | null
          id?: string
          message_type?: string | null
          read?: boolean | null
          read_at?: string | null
          room_id?: string | null
          sender_id?: string | null
        }
        Update: {
          attachments?: Json | null
          content?: string | null
          created_date?: string | null
          file_url?: string | null
          id?: string
          message_type?: string | null
          read?: boolean | null
          read_at?: string | null
          room_id?: string | null
          sender_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_collab_messages_room_id_fkey"
            columns: ["room_id"]
            isOneToOne: false
            referencedRelation: "devlink_collab_rooms"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_collab_messages_sender_id_fkey"
            columns: ["sender_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_collab_rooms: {
        Row: {
          code_snippets: Json | null
          created_at: string | null
          creator_id: string | null
          id: string
          participant_ids: string[] | null
          related_job_id: string | null
          room_name: string
          room_type: string | null
          started_at: string | null
          status: string | null
        }
        Insert: {
          code_snippets?: Json | null
          created_at?: string | null
          creator_id?: string | null
          id?: string
          participant_ids?: string[] | null
          related_job_id?: string | null
          room_name: string
          room_type?: string | null
          started_at?: string | null
          status?: string | null
        }
        Update: {
          code_snippets?: Json | null
          created_at?: string | null
          creator_id?: string | null
          id?: string
          participant_ids?: string[] | null
          related_job_id?: string | null
          room_name?: string
          room_type?: string | null
          started_at?: string | null
          status?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_collab_rooms_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_collab_rooms_related_job_id_fkey"
            columns: ["related_job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_collab_tasks: {
        Row: {
          assigned_to: string | null
          blocked_by: string[] | null
          created_at: string | null
          created_by: string | null
          description: string | null
          due_date: string | null
          estimated_hours: number | null
          id: string
          priority: string | null
          room_id: string | null
          status: string | null
          title: string
        }
        Insert: {
          assigned_to?: string | null
          blocked_by?: string[] | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          estimated_hours?: number | null
          id?: string
          priority?: string | null
          room_id?: string | null
          status?: string | null
          title: string
        }
        Update: {
          assigned_to?: string | null
          blocked_by?: string[] | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          due_date?: string | null
          estimated_hours?: number | null
          id?: string
          priority?: string | null
          room_id?: string | null
          status?: string | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "devlink_collab_tasks_assigned_to_fkey"
            columns: ["assigned_to"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_collab_tasks_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_collab_tasks_room_id_fkey"
            columns: ["room_id"]
            isOneToOne: false
            referencedRelation: "devlink_collab_rooms"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_company_profiles: {
        Row: {
          banner_url: string | null
          brand_colors: Json | null
          company_name: string
          company_size: string | null
          created_at: string | null
          culture_values: string[] | null
          current_projects: Json | null
          description: string | null
          founded_year: number | null
          id: string
          industry: string | null
          location: string | null
          logo_url: string | null
          perks_benefits: string[] | null
          social_links: Json | null
          tagline: string | null
          tech_stack: string[] | null
          updated_at: string | null
          user_id: string | null
          verified: boolean | null
          website_url: string | null
        }
        Insert: {
          banner_url?: string | null
          brand_colors?: Json | null
          company_name: string
          company_size?: string | null
          created_at?: string | null
          culture_values?: string[] | null
          current_projects?: Json | null
          description?: string | null
          founded_year?: number | null
          id?: string
          industry?: string | null
          location?: string | null
          logo_url?: string | null
          perks_benefits?: string[] | null
          social_links?: Json | null
          tagline?: string | null
          tech_stack?: string[] | null
          updated_at?: string | null
          user_id?: string | null
          verified?: boolean | null
          website_url?: string | null
        }
        Update: {
          banner_url?: string | null
          brand_colors?: Json | null
          company_name?: string
          company_size?: string | null
          created_at?: string | null
          culture_values?: string[] | null
          current_projects?: Json | null
          description?: string | null
          founded_year?: number | null
          id?: string
          industry?: string | null
          location?: string | null
          logo_url?: string | null
          perks_benefits?: string[] | null
          social_links?: Json | null
          tagline?: string | null
          tech_stack?: string[] | null
          updated_at?: string | null
          user_id?: string | null
          verified?: boolean | null
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_company_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_daily_challenges: {
        Row: {
          bonus_xp: number | null
          challenge_type: string | null
          completed: boolean | null
          completed_at: string | null
          current_progress: number | null
          date: string | null
          description: string | null
          id: string
          streak_bonus: number | null
          target_count: number | null
          title: string | null
          user_id: string | null
          xp_reward: number | null
        }
        Insert: {
          bonus_xp?: number | null
          challenge_type?: string | null
          completed?: boolean | null
          completed_at?: string | null
          current_progress?: number | null
          date?: string | null
          description?: string | null
          id?: string
          streak_bonus?: number | null
          target_count?: number | null
          title?: string | null
          user_id?: string | null
          xp_reward?: number | null
        }
        Update: {
          bonus_xp?: number | null
          challenge_type?: string | null
          completed?: boolean | null
          completed_at?: string | null
          current_progress?: number | null
          date?: string | null
          description?: string | null
          id?: string
          streak_bonus?: number | null
          target_count?: number | null
          title?: string | null
          user_id?: string | null
          xp_reward?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_daily_challenges_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_endorsements: {
        Row: {
          created_date: string | null
          endorsee_id: string | null
          endorsement_strength: number | null
          endorser_id: string | null
          id: string
          relationship: string | null
          skill_name: string
        }
        Insert: {
          created_date?: string | null
          endorsee_id?: string | null
          endorsement_strength?: number | null
          endorser_id?: string | null
          id?: string
          relationship?: string | null
          skill_name: string
        }
        Update: {
          created_date?: string | null
          endorsee_id?: string | null
          endorsement_strength?: number | null
          endorser_id?: string | null
          id?: string
          relationship?: string | null
          skill_name?: string
        }
        Relationships: [
          {
            foreignKeyName: "devlink_endorsements_endorsee_id_fkey"
            columns: ["endorsee_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_endorsements_endorser_id_fkey"
            columns: ["endorser_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_escrow_transactions: {
        Row: {
          created_date: string | null
          currency: string | null
          developer_id: string | null
          employer_id: string | null
          funded_amount: number | null
          funded_date: string | null
          id: string
          job_id: string | null
          released_amount: number | null
          status: string | null
          total_amount: number | null
        }
        Insert: {
          created_date?: string | null
          currency?: string | null
          developer_id?: string | null
          employer_id?: string | null
          funded_amount?: number | null
          funded_date?: string | null
          id?: string
          job_id?: string | null
          released_amount?: number | null
          status?: string | null
          total_amount?: number | null
        }
        Update: {
          created_date?: string | null
          currency?: string | null
          developer_id?: string | null
          employer_id?: string | null
          funded_amount?: number | null
          funded_date?: string | null
          id?: string
          job_id?: string | null
          released_amount?: number | null
          status?: string | null
          total_amount?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_escrow_transactions_developer_id_fkey"
            columns: ["developer_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_escrow_transactions_employer_id_fkey"
            columns: ["employer_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_escrow_transactions_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_forum_posts: {
        Row: {
          author_id: string | null
          category: string | null
          content: string | null
          created_at: string | null
          downvotes: number | null
          id: string
          locked: boolean | null
          pinned: boolean | null
          reply_count: number | null
          tags: string[] | null
          title: string
          updated_at: string | null
          upvotes: number | null
          view_count: number | null
        }
        Insert: {
          author_id?: string | null
          category?: string | null
          content?: string | null
          created_at?: string | null
          downvotes?: number | null
          id?: string
          locked?: boolean | null
          pinned?: boolean | null
          reply_count?: number | null
          tags?: string[] | null
          title: string
          updated_at?: string | null
          upvotes?: number | null
          view_count?: number | null
        }
        Update: {
          author_id?: string | null
          category?: string | null
          content?: string | null
          created_at?: string | null
          downvotes?: number | null
          id?: string
          locked?: boolean | null
          pinned?: boolean | null
          reply_count?: number | null
          tags?: string[] | null
          title?: string
          updated_at?: string | null
          upvotes?: number | null
          view_count?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_forum_posts_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_forum_replies: {
        Row: {
          author_id: string | null
          content: string
          created_at: string | null
          downvotes: number | null
          id: string
          is_solution: boolean | null
          post_id: string | null
          upvotes: number | null
        }
        Insert: {
          author_id?: string | null
          content: string
          created_at?: string | null
          downvotes?: number | null
          id?: string
          is_solution?: boolean | null
          post_id?: string | null
          upvotes?: number | null
        }
        Update: {
          author_id?: string | null
          content?: string
          created_at?: string | null
          downvotes?: number | null
          id?: string
          is_solution?: boolean | null
          post_id?: string | null
          upvotes?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_forum_replies_author_id_fkey"
            columns: ["author_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_forum_replies_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "devlink_forum_posts"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_jobs: {
        Row: {
          application_count: number | null
          application_deadline: string | null
          budget_range: Json | null
          company_logo: string | null
          company_name: string | null
          company_size: string | null
          created_date: string | null
          description: string | null
          employer_id: string | null
          experience_level: string | null
          frameworks: string[] | null
          id: string
          metadata: Json | null
          payment_type: string | null
          preferred_locations: string[] | null
          preferred_timezones: string[] | null
          programming_languages: string[] | null
          remote_type: string | null
          required_roles: string[] | null
          required_skills: string[] | null
          salary_max: number | null
          salary_min: number | null
          status: string | null
          timeline: string | null
          title: string
          updated_at: string | null
          view_count: number | null
        }
        Insert: {
          application_count?: number | null
          application_deadline?: string | null
          budget_range?: Json | null
          company_logo?: string | null
          company_name?: string | null
          company_size?: string | null
          created_date?: string | null
          description?: string | null
          employer_id?: string | null
          experience_level?: string | null
          frameworks?: string[] | null
          id?: string
          metadata?: Json | null
          payment_type?: string | null
          preferred_locations?: string[] | null
          preferred_timezones?: string[] | null
          programming_languages?: string[] | null
          remote_type?: string | null
          required_roles?: string[] | null
          required_skills?: string[] | null
          salary_max?: number | null
          salary_min?: number | null
          status?: string | null
          timeline?: string | null
          title: string
          updated_at?: string | null
          view_count?: number | null
        }
        Update: {
          application_count?: number | null
          application_deadline?: string | null
          budget_range?: Json | null
          company_logo?: string | null
          company_name?: string | null
          company_size?: string | null
          created_date?: string | null
          description?: string | null
          employer_id?: string | null
          experience_level?: string | null
          frameworks?: string[] | null
          id?: string
          metadata?: Json | null
          payment_type?: string | null
          preferred_locations?: string[] | null
          preferred_timezones?: string[] | null
          programming_languages?: string[] | null
          remote_type?: string | null
          required_roles?: string[] | null
          required_skills?: string[] | null
          salary_max?: number | null
          salary_min?: number | null
          status?: string | null
          timeline?: string | null
          title?: string
          updated_at?: string | null
          view_count?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_jobs_employer_id_fkey"
            columns: ["employer_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_learning_paths: {
        Row: {
          ai_recommendations: Json | null
          created_at: string | null
          current_level: string | null
          estimated_duration_weeks: number | null
          id: string
          last_updated: string | null
          milestones: Json | null
          path_name: string
          progress_percentage: number | null
          recommended_resources: Json | null
          skill_gaps: Json | null
          suggested_projects: Json | null
          target_level: string | null
          target_role: string | null
          user_id: string | null
        }
        Insert: {
          ai_recommendations?: Json | null
          created_at?: string | null
          current_level?: string | null
          estimated_duration_weeks?: number | null
          id?: string
          last_updated?: string | null
          milestones?: Json | null
          path_name: string
          progress_percentage?: number | null
          recommended_resources?: Json | null
          skill_gaps?: Json | null
          suggested_projects?: Json | null
          target_level?: string | null
          target_role?: string | null
          user_id?: string | null
        }
        Update: {
          ai_recommendations?: Json | null
          created_at?: string | null
          current_level?: string | null
          estimated_duration_weeks?: number | null
          id?: string
          last_updated?: string | null
          milestones?: Json | null
          path_name?: string
          progress_percentage?: number | null
          recommended_resources?: Json | null
          skill_gaps?: Json | null
          suggested_projects?: Json | null
          target_level?: string | null
          target_role?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_learning_paths_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_messages: {
        Row: {
          content: string
          created_at: string | null
          id: string
          read: boolean | null
          receiver_id: string | null
          sender_id: string | null
        }
        Insert: {
          content: string
          created_at?: string | null
          id?: string
          read?: boolean | null
          receiver_id?: string | null
          sender_id?: string | null
        }
        Update: {
          content?: string
          created_at?: string | null
          id?: string
          read?: boolean | null
          receiver_id?: string | null
          sender_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_messages_receiver_id_fkey"
            columns: ["receiver_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_messages_sender_id_fkey"
            columns: ["sender_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_milestones: {
        Row: {
          amount: number | null
          approved_date: string | null
          created_at: string | null
          description: string | null
          escrow_id: string | null
          id: string
          job_id: string | null
          status: string | null
          submission_notes: string | null
          submitted_date: string | null
          title: string
        }
        Insert: {
          amount?: number | null
          approved_date?: string | null
          created_at?: string | null
          description?: string | null
          escrow_id?: string | null
          id?: string
          job_id?: string | null
          status?: string | null
          submission_notes?: string | null
          submitted_date?: string | null
          title: string
        }
        Update: {
          amount?: number | null
          approved_date?: string | null
          created_at?: string | null
          description?: string | null
          escrow_id?: string | null
          id?: string
          job_id?: string | null
          status?: string | null
          submission_notes?: string | null
          submitted_date?: string | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "devlink_milestones_escrow_id_fkey"
            columns: ["escrow_id"]
            isOneToOne: false
            referencedRelation: "devlink_escrow_transactions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_milestones_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_notifications: {
        Row: {
          created_date: string | null
          id: string
          link: string | null
          message: string | null
          metadata: Json | null
          read: boolean | null
          title: string
          type: string | null
          user_id: string | null
        }
        Insert: {
          created_date?: string | null
          id?: string
          link?: string | null
          message?: string | null
          metadata?: Json | null
          read?: boolean | null
          title: string
          type?: string | null
          user_id?: string | null
        }
        Update: {
          created_date?: string | null
          id?: string
          link?: string | null
          message?: string | null
          metadata?: Json | null
          read?: boolean | null
          title?: string
          type?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_notifications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_portfolios: {
        Row: {
          created_at: string | null
          description: string | null
          featured: boolean | null
          github_url: string | null
          id: string
          images: string[] | null
          live_url: string | null
          project_type: string | null
          roblox_game_id: string | null
          technologies: string[] | null
          title: string
          user_id: string | null
          video_url: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          featured?: boolean | null
          github_url?: string | null
          id?: string
          images?: string[] | null
          live_url?: string | null
          project_type?: string | null
          roblox_game_id?: string | null
          technologies?: string[] | null
          title: string
          user_id?: string | null
          video_url?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          featured?: boolean | null
          github_url?: string | null
          id?: string
          images?: string[] | null
          live_url?: string | null
          project_type?: string | null
          roblox_game_id?: string | null
          technologies?: string[] | null
          title?: string
          user_id?: string | null
          video_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_portfolios_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_profiles: {
        Row: {
          admin: boolean | null
          avatar_customization: Json | null
          avatar_url: string | null
          banner_url: string | null
          bio: string | null
          community_points: number | null
          company_id: string | null
          company_name: string | null
          created_at: string | null
          developer_roles: string[] | null
          devforum_username: string | null
          devforum_verified: boolean | null
          email: string | null
          experience_level: string | null
          forum_reputation: number | null
          full_name: string | null
          github_username: string | null
          github_verified: boolean | null
          hourly_rate: number | null
          id: string
          is_premium: boolean | null
          level: number | null
          payment_preferences: Json | null
          platform_roles: string[] | null
          portfolio_links: string[] | null
          roblox_avatar_url: string | null
          roblox_data: Json | null
          roblox_reputation_score: number | null
          roblox_reputation_tier: string | null
          roblox_user_id: string | null
          roblox_username: string | null
          roblox_verified: boolean | null
          skills: string[] | null
          streak_days: number | null
          stripe_account_id: string | null
          updated_at: string | null
          use_roblox_avatar: boolean | null
          use_roblox_display_name: boolean | null
          user_type: string | null
          work_status: string | null
          xp_points: number | null
          years_of_experience: number | null
        }
        Insert: {
          admin?: boolean | null
          avatar_customization?: Json | null
          avatar_url?: string | null
          banner_url?: string | null
          bio?: string | null
          community_points?: number | null
          company_id?: string | null
          company_name?: string | null
          created_at?: string | null
          developer_roles?: string[] | null
          devforum_username?: string | null
          devforum_verified?: boolean | null
          email?: string | null
          experience_level?: string | null
          forum_reputation?: number | null
          full_name?: string | null
          github_username?: string | null
          github_verified?: boolean | null
          hourly_rate?: number | null
          id?: string
          is_premium?: boolean | null
          level?: number | null
          payment_preferences?: Json | null
          platform_roles?: string[] | null
          portfolio_links?: string[] | null
          roblox_avatar_url?: string | null
          roblox_data?: Json | null
          roblox_reputation_score?: number | null
          roblox_reputation_tier?: string | null
          roblox_user_id?: string | null
          roblox_username?: string | null
          roblox_verified?: boolean | null
          skills?: string[] | null
          streak_days?: number | null
          stripe_account_id?: string | null
          updated_at?: string | null
          use_roblox_avatar?: boolean | null
          use_roblox_display_name?: boolean | null
          user_type?: string | null
          work_status?: string | null
          xp_points?: number | null
          years_of_experience?: number | null
        }
        Update: {
          admin?: boolean | null
          avatar_customization?: Json | null
          avatar_url?: string | null
          banner_url?: string | null
          bio?: string | null
          community_points?: number | null
          company_id?: string | null
          company_name?: string | null
          created_at?: string | null
          developer_roles?: string[] | null
          devforum_username?: string | null
          devforum_verified?: boolean | null
          email?: string | null
          experience_level?: string | null
          forum_reputation?: number | null
          full_name?: string | null
          github_username?: string | null
          github_verified?: boolean | null
          hourly_rate?: number | null
          id?: string
          is_premium?: boolean | null
          level?: number | null
          payment_preferences?: Json | null
          platform_roles?: string[] | null
          portfolio_links?: string[] | null
          roblox_avatar_url?: string | null
          roblox_data?: Json | null
          roblox_reputation_score?: number | null
          roblox_reputation_tier?: string | null
          roblox_user_id?: string | null
          roblox_username?: string | null
          roblox_verified?: boolean | null
          skills?: string[] | null
          streak_days?: number | null
          stripe_account_id?: string | null
          updated_at?: string | null
          use_roblox_avatar?: boolean | null
          use_roblox_display_name?: boolean | null
          user_type?: string | null
          work_status?: string | null
          xp_points?: number | null
          years_of_experience?: number | null
        }
        Relationships: []
      }
      devlink_reviews: {
        Row: {
          categories: Json | null
          created_date: string | null
          id: string
          job_id: string | null
          rating: number | null
          review_text: string | null
          review_type: string | null
          reviewee_id: string | null
          reviewer_id: string | null
          updated_at: string | null
          would_work_again: boolean | null
        }
        Insert: {
          categories?: Json | null
          created_date?: string | null
          id?: string
          job_id?: string | null
          rating?: number | null
          review_text?: string | null
          review_type?: string | null
          reviewee_id?: string | null
          reviewer_id?: string | null
          updated_at?: string | null
          would_work_again?: boolean | null
        }
        Update: {
          categories?: Json | null
          created_date?: string | null
          id?: string
          job_id?: string | null
          rating?: number | null
          review_text?: string | null
          review_type?: string | null
          reviewee_id?: string | null
          reviewer_id?: string | null
          updated_at?: string | null
          would_work_again?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_reviews_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_reviews_reviewee_id_fkey"
            columns: ["reviewee_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_reviews_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_saved_jobs: {
        Row: {
          created_date: string | null
          id: string
          job_id: string | null
          notes: string | null
          priority: string | null
          user_id: string | null
        }
        Insert: {
          created_date?: string | null
          id?: string
          job_id?: string | null
          notes?: string | null
          priority?: string | null
          user_id?: string | null
        }
        Update: {
          created_date?: string | null
          id?: string
          job_id?: string | null
          notes?: string | null
          priority?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_saved_jobs_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "devlink_jobs"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "devlink_saved_jobs_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_skill_assessments: {
        Row: {
          anti_cheat_flags: Json | null
          assessment_type: string | null
          created_at: string | null
          id: string
          passed: boolean | null
          passing_score: number | null
          proctoring_enabled: boolean | null
          questions: Json | null
          questions_answered: number | null
          questions_correct: number | null
          score: number | null
          skill_name: string
          time_limit_minutes: number | null
          time_taken_minutes: number | null
          user_id: string | null
        }
        Insert: {
          anti_cheat_flags?: Json | null
          assessment_type?: string | null
          created_at?: string | null
          id?: string
          passed?: boolean | null
          passing_score?: number | null
          proctoring_enabled?: boolean | null
          questions?: Json | null
          questions_answered?: number | null
          questions_correct?: number | null
          score?: number | null
          skill_name: string
          time_limit_minutes?: number | null
          time_taken_minutes?: number | null
          user_id?: string | null
        }
        Update: {
          anti_cheat_flags?: Json | null
          assessment_type?: string | null
          created_at?: string | null
          id?: string
          passed?: boolean | null
          passing_score?: number | null
          proctoring_enabled?: boolean | null
          questions?: Json | null
          questions_answered?: number | null
          questions_correct?: number | null
          score?: number | null
          skill_name?: string
          time_limit_minutes?: number | null
          time_taken_minutes?: number | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_skill_assessments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_studios: {
        Row: {
          banner_url: string | null
          company_profile_id: string | null
          created_at: string | null
          description: string | null
          id: string
          member_count: number | null
          roblox_group_data: Json | null
          roblox_group_id: string | null
          status: string | null
          studio_name: string | null
          total_games: number | null
          total_visits: number | null
          updated_at: string | null
          user_rank_in_group: number | null
          user_role_in_group: string | null
          verified: boolean | null
        }
        Insert: {
          banner_url?: string | null
          company_profile_id?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          member_count?: number | null
          roblox_group_data?: Json | null
          roblox_group_id?: string | null
          status?: string | null
          studio_name?: string | null
          total_games?: number | null
          total_visits?: number | null
          updated_at?: string | null
          user_rank_in_group?: number | null
          user_role_in_group?: string | null
          verified?: boolean | null
        }
        Update: {
          banner_url?: string | null
          company_profile_id?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          member_count?: number | null
          roblox_group_data?: Json | null
          roblox_group_id?: string | null
          status?: string | null
          studio_name?: string | null
          total_games?: number | null
          total_visits?: number | null
          updated_at?: string | null
          user_rank_in_group?: number | null
          user_role_in_group?: string | null
          verified?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_studios_company_profile_id_fkey"
            columns: ["company_profile_id"]
            isOneToOne: false
            referencedRelation: "devlink_company_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_teams: {
        Row: {
          created_at: string | null
          description: string | null
          id: string
          logo_url: string | null
          member_ids: string[] | null
          name: string
          owner_id: string | null
          status: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          id?: string
          logo_url?: string | null
          member_ids?: string[] | null
          name: string
          owner_id?: string | null
          status?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          id?: string
          logo_url?: string | null
          member_ids?: string[] | null
          name?: string
          owner_id?: string | null
          status?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "devlink_teams_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "devlink_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      devlink_waitlist_signups: {
        Row: {
          created_at: string | null
          email: string
          id: string
          name: string | null
          referral_source: string | null
          user_type: string | null
        }
        Insert: {
          created_at?: string | null
          email: string
          id?: string
          name?: string | null
          referral_source?: string | null
          user_type?: string | null
        }
        Update: {
          created_at?: string | null
          email?: string
          id?: string
          name?: string | null
          referral_source?: string | null
          user_type?: string | null
        }
        Relationships: []
      }
      discord_checkins: {
        Row: {
          channel_id: string | null
          checkin_type: string
          created_at: string | null
          discord_user_id: string
          id: string
          message: string | null
          user_id: string | null
        }
        Insert: {
          channel_id?: string | null
          checkin_type: string
          created_at?: string | null
          discord_user_id: string
          id?: string
          message?: string | null
          user_id?: string | null
        }
        Update: {
          channel_id?: string | null
          checkin_type?: string
          created_at?: string | null
          discord_user_id?: string
          id?: string
          message?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      discord_config: {
        Row: {
          key: string
          updated_at: string | null
          value: Json
        }
        Insert: {
          key: string
          updated_at?: string | null
          value: Json
        }
        Update: {
          key?: string
          updated_at?: string | null
          value?: Json
        }
        Relationships: []
      }
      discord_linking_sessions: {
        Row: {
          created_at: string | null
          expires_at: string
          id: string
          session_token: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          expires_at: string
          id?: string
          session_token: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          expires_at?: string
          id?: string
          session_token?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "discord_linking_sessions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      discord_links: {
        Row: {
          discord_id: string
          id: string
          linked_at: string | null
          primary_arm: string | null
          updated_at: string | null
          user_id: string
        }
        Insert: {
          discord_id: string
          id?: string
          linked_at?: string | null
          primary_arm?: string | null
          updated_at?: string | null
          user_id: string
        }
        Update: {
          discord_id?: string
          id?: string
          linked_at?: string | null
          primary_arm?: string | null
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "discord_links_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      discord_pending_links: {
        Row: {
          created_at: string | null
          discord_id: string
          discord_username: string | null
          expires_at: string
          id: string
          verification_code: string
        }
        Insert: {
          created_at?: string | null
          discord_id: string
          discord_username?: string | null
          expires_at: string
          id?: string
          verification_code: string
        }
        Update: {
          created_at?: string | null
          discord_id?: string
          discord_username?: string | null
          expires_at?: string
          id?: string
          verification_code?: string
        }
        Relationships: []
      }
      discord_post_webhooks: {
        Row: {
          arm_affiliation: string
          auto_post: boolean | null
          channel_id: string
          created_at: string
          guild_id: string
          id: string
          updated_at: string
          user_id: string
          webhook_id: string
          webhook_url: string
        }
        Insert: {
          arm_affiliation: string
          auto_post?: boolean | null
          channel_id: string
          created_at?: string
          guild_id: string
          id?: string
          updated_at?: string
          user_id: string
          webhook_id: string
          webhook_url: string
        }
        Update: {
          arm_affiliation?: string
          auto_post?: boolean | null
          channel_id?: string
          created_at?: string
          guild_id?: string
          id?: string
          updated_at?: string
          user_id?: string
          webhook_id?: string
          webhook_url?: string
        }
        Relationships: [
          {
            foreignKeyName: "discord_post_webhooks_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      discord_role_mappings: {
        Row: {
          arm: string
          created_at: string | null
          discord_role_id: string | null
          discord_role_name: string
          id: string
          server_id: string | null
          updated_at: string | null
          user_type: string
        }
        Insert: {
          arm: string
          created_at?: string | null
          discord_role_id?: string | null
          discord_role_name: string
          id?: string
          server_id?: string | null
          updated_at?: string | null
          user_type: string
        }
        Update: {
          arm?: string
          created_at?: string | null
          discord_role_id?: string | null
          discord_role_name?: string
          id?: string
          server_id?: string | null
          updated_at?: string | null
          user_type?: string
        }
        Relationships: []
      }
      discord_user_roles: {
        Row: {
          assigned_at: string | null
          discord_id: string
          id: string
          last_verified: string | null
          role_id: string
          role_name: string
          server_id: string
        }
        Insert: {
          assigned_at?: string | null
          discord_id: string
          id?: string
          last_verified?: string | null
          role_id: string
          role_name: string
          server_id: string
        }
        Update: {
          assigned_at?: string | null
          discord_id?: string
          id?: string
          last_verified?: string | null
          role_id?: string
          role_name?: string
          server_id?: string
        }
        Relationships: []
      }
      discord_verifications: {
        Row: {
          created_at: string | null
          discord_id: string
          expires_at: string
          id: string
          verification_code: string
        }
        Insert: {
          created_at?: string | null
          discord_id: string
          expires_at: string
          id?: string
          verification_code: string
        }
        Update: {
          created_at?: string | null
          discord_id?: string
          expires_at?: string
          id?: string
          verification_code?: string
        }
        Relationships: []
      }
      doc_edits: {
        Row: {
          content: string
          id: number
          page_id: string
          space_id: string
          title: string
          updated_at: string | null
          updated_by: string | null
        }
        Insert: {
          content: string
          id?: number
          page_id: string
          space_id: string
          title: string
          updated_at?: string | null
          updated_by?: string | null
        }
        Update: {
          content?: string
          id?: number
          page_id?: string
          space_id?: string
          title?: string
          updated_at?: string | null
          updated_by?: string | null
        }
        Relationships: []
      }
      document: {
        Row: {
          collection_name: string
          content: string | null
          filename: string
          id: number
          name: string
          timestamp: number
          title: string
          user_id: string
        }
        Insert: {
          collection_name: string
          content?: string | null
          filename: string
          id?: number
          name: string
          timestamp: number
          title: string
          user_id: string
        }
        Update: {
          collection_name?: string
          content?: string | null
          filename?: string
          id?: number
          name?: string
          timestamp?: number
          title?: string
          user_id?: string
        }
        Relationships: []
      }
      documentation: {
        Row: {
          category: string | null
          content: string
          created_at: string | null
          id: string
          is_published: boolean | null
          order: number | null
          slug: string
          title: string
          updated_at: string | null
        }
        Insert: {
          category?: string | null
          content: string
          created_at?: string | null
          id: string
          is_published?: boolean | null
          order?: number | null
          slug: string
          title: string
          updated_at?: string | null
        }
        Update: {
          category?: string | null
          content?: string
          created_at?: string | null
          id?: string
          is_published?: boolean | null
          order?: number | null
          slug?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: []
      }
      domain_transfers: {
        Row: {
          completed_at: string | null
          created_at: string | null
          domain_id: string
          from_user_id: string | null
          id: string
          price_usd: number | null
          status: string | null
          to_user_id: string | null
          transaction_hash: string | null
          transfer_type: string | null
        }
        Insert: {
          completed_at?: string | null
          created_at?: string | null
          domain_id: string
          from_user_id?: string | null
          id?: string
          price_usd?: number | null
          status?: string | null
          to_user_id?: string | null
          transaction_hash?: string | null
          transfer_type?: string | null
        }
        Update: {
          completed_at?: string | null
          created_at?: string | null
          domain_id?: string
          from_user_id?: string | null
          id?: string
          price_usd?: number | null
          status?: string | null
          to_user_id?: string | null
          transaction_hash?: string | null
          transfer_type?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "domain_transfers_domain_id_fkey"
            columns: ["domain_id"]
            isOneToOne: false
            referencedRelation: "blockchain_domains"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "domain_transfers_from_user_id_fkey"
            columns: ["from_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "domain_transfers_to_user_id_fkey"
            columns: ["to_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      domain_verifications: {
        Row: {
          created_at: string | null
          domain: string
          expires_at: string | null
          id: string
          user_id: string
          verification_token: string
          verification_type: string | null
          verified: boolean | null
          verified_at: string | null
        }
        Insert: {
          created_at?: string | null
          domain: string
          expires_at?: string | null
          id?: string
          user_id: string
          verification_token: string
          verification_type?: string | null
          verified?: boolean | null
          verified_at?: string | null
        }
        Update: {
          created_at?: string | null
          domain?: string
          expires_at?: string | null
          id?: string
          user_id?: string
          verification_token?: string
          verification_type?: string | null
          verified?: boolean | null
          verified_at?: string | null
        }
        Relationships: []
      }
      employee_data: {
        Row: {
          benefits_info: Json | null
          compliance_docs: Json | null
          created_at: string | null
          id: string
          job_history: Json | null
          personal_details: Json | null
          site_id: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          benefits_info?: Json | null
          compliance_docs?: Json | null
          created_at?: string | null
          id?: string
          job_history?: Json | null
          personal_details?: Json | null
          site_id: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          benefits_info?: Json | null
          compliance_docs?: Json | null
          created_at?: string | null
          id?: string
          job_history?: Json | null
          personal_details?: Json | null
          site_id?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "employee_data_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "employee_data_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "employee_data_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      employee_edits: {
        Row: {
          data: Json
          employee_id: string
          id: number
          updated_at: string | null
          updated_by: string | null
        }
        Insert: {
          data: Json
          employee_id: string
          id?: number
          updated_at?: string | null
          updated_by?: string | null
        }
        Update: {
          data?: Json
          employee_id?: string
          id?: number
          updated_at?: string | null
          updated_by?: string | null
        }
        Relationships: []
      }
      endorsements: {
        Row: {
          created_at: string
          endorsed_id: string
          endorser_id: string
          id: string
          skill: string
        }
        Insert: {
          created_at?: string
          endorsed_id: string
          endorser_id: string
          id?: string
          skill: string
        }
        Update: {
          created_at?: string
          endorsed_id?: string
          endorser_id?: string
          id?: string
          skill?: string
        }
        Relationships: []
      }
      enrollments: {
        Row: {
          completed_at: string | null
          course_id: string | null
          enrolled_at: string | null
          id: string
          last_accessed_at: string | null
          progress_percent: number | null
          user_id: string | null
        }
        Insert: {
          completed_at?: string | null
          course_id?: string | null
          enrolled_at?: string | null
          id?: string
          last_accessed_at?: string | null
          progress_percent?: number | null
          user_id?: string | null
        }
        Update: {
          completed_at?: string | null
          course_id?: string | null
          enrolled_at?: string | null
          id?: string
          last_accessed_at?: string | null
          progress_percent?: number | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "enrollments_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "courses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "enrollments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      enterprise_accounts: {
        Row: {
          created_at: string | null
          current_users: number | null
          custom_branding: Json | null
          custom_domain: string | null
          custom_domain_verified: boolean | null
          dedicated_infrastructure: boolean | null
          dns_txt_record: string | null
          id: string
          max_users: number | null
          organization_name: string
          owner_user_id: string
          sla_tier: string | null
          subscription_id: string | null
          updated_at: string | null
          white_label_enabled: boolean | null
        }
        Insert: {
          created_at?: string | null
          current_users?: number | null
          custom_branding?: Json | null
          custom_domain?: string | null
          custom_domain_verified?: boolean | null
          dedicated_infrastructure?: boolean | null
          dns_txt_record?: string | null
          id?: string
          max_users?: number | null
          organization_name: string
          owner_user_id: string
          sla_tier?: string | null
          subscription_id?: string | null
          updated_at?: string | null
          white_label_enabled?: boolean | null
        }
        Update: {
          created_at?: string | null
          current_users?: number | null
          custom_branding?: Json | null
          custom_domain?: string | null
          custom_domain_verified?: boolean | null
          dedicated_infrastructure?: boolean | null
          dns_txt_record?: string | null
          id?: string
          max_users?: number | null
          organization_name?: string
          owner_user_id?: string
          sla_tier?: string | null
          subscription_id?: string | null
          updated_at?: string | null
          white_label_enabled?: boolean | null
        }
        Relationships: [
          {
            foreignKeyName: "enterprise_accounts_owner_user_id_fkey"
            columns: ["owner_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "enterprise_accounts_subscription_id_fkey"
            columns: ["subscription_id"]
            isOneToOne: false
            referencedRelation: "premium_subscriptions"
            referencedColumns: ["id"]
          },
        ]
      }
      enterprise_team_members: {
        Row: {
          enterprise_id: string
          id: string
          joined_at: string | null
          role: string | null
          user_id: string
        }
        Insert: {
          enterprise_id: string
          id?: string
          joined_at?: string | null
          role?: string | null
          user_id: string
        }
        Update: {
          enterprise_id?: string
          id?: string
          joined_at?: string | null
          role?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "enterprise_team_members_enterprise_id_fkey"
            columns: ["enterprise_id"]
            isOneToOne: false
            referencedRelation: "enterprise_accounts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "enterprise_team_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_artist_profiles: {
        Row: {
          bio: string | null
          created_at: string
          ecosystem_license_accepted: boolean
          ecosystem_license_accepted_at: string | null
          for_hire: boolean
          portfolio_url: string | null
          price_list: Json | null
          sample_price_score: number | null
          sample_price_sfx: number | null
          sample_price_track: number | null
          skills: string[]
          total_downloads: number
          turnaround_days: number | null
          updated_at: string
          user_id: string
          verified: boolean
        }
        Insert: {
          bio?: string | null
          created_at?: string
          ecosystem_license_accepted?: boolean
          ecosystem_license_accepted_at?: string | null
          for_hire?: boolean
          portfolio_url?: string | null
          price_list?: Json | null
          sample_price_score?: number | null
          sample_price_sfx?: number | null
          sample_price_track?: number | null
          skills?: string[]
          total_downloads?: number
          turnaround_days?: number | null
          updated_at?: string
          user_id: string
          verified?: boolean
        }
        Update: {
          bio?: string | null
          created_at?: string
          ecosystem_license_accepted?: boolean
          ecosystem_license_accepted_at?: string | null
          for_hire?: boolean
          portfolio_url?: string | null
          price_list?: Json | null
          sample_price_score?: number | null
          sample_price_sfx?: number | null
          sample_price_track?: number | null
          skills?: string[]
          total_downloads?: number
          turnaround_days?: number | null
          updated_at?: string
          user_id?: string
          verified?: boolean
        }
        Relationships: [
          {
            foreignKeyName: "ethos_artist_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_ecosystem_licenses: {
        Row: {
          accepted_at: string
          agreement_text_hash: string | null
          agreement_version: string
          artist_id: string
          created_at: string
          id: string
          track_id: string
        }
        Insert: {
          accepted_at?: string
          agreement_text_hash?: string | null
          agreement_version?: string
          artist_id: string
          created_at?: string
          id?: string
          track_id: string
        }
        Update: {
          accepted_at?: string
          agreement_text_hash?: string | null
          agreement_version?: string
          artist_id?: string
          created_at?: string
          id?: string
          track_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_ecosystem_licenses_artist_id_fkey"
            columns: ["artist_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ethos_ecosystem_licenses_track_id_fkey"
            columns: ["track_id"]
            isOneToOne: false
            referencedRelation: "ethos_tracks"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_guild_members: {
        Row: {
          bio: string | null
          id: string
          joined_at: string
          role: string
          user_id: string
        }
        Insert: {
          bio?: string | null
          id?: string
          joined_at?: string
          role?: string
          user_id: string
        }
        Update: {
          bio?: string | null
          id?: string
          joined_at?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_guild_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_licensing_agreements: {
        Row: {
          agreement_url: string | null
          approved: boolean
          created_at: string
          expires_at: string | null
          id: string
          license_type: string
          licensee_id: string
          track_id: string
        }
        Insert: {
          agreement_url?: string | null
          approved?: boolean
          created_at?: string
          expires_at?: string | null
          id?: string
          license_type: string
          licensee_id: string
          track_id: string
        }
        Update: {
          agreement_url?: string | null
          approved?: boolean
          created_at?: string
          expires_at?: string | null
          id?: string
          license_type?: string
          licensee_id?: string
          track_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_licensing_agreements_licensee_id_fkey"
            columns: ["licensee_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ethos_licensing_agreements_track_id_fkey"
            columns: ["track_id"]
            isOneToOne: false
            referencedRelation: "ethos_tracks"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_service_requests: {
        Row: {
          artist_id: string
          budget: number | null
          created_at: string
          deadline: string | null
          description: string
          id: string
          notes: string | null
          requester_id: string
          service_type: string
          status: string
          updated_at: string
        }
        Insert: {
          artist_id: string
          budget?: number | null
          created_at?: string
          deadline?: string | null
          description: string
          id?: string
          notes?: string | null
          requester_id: string
          service_type: string
          status?: string
          updated_at?: string
        }
        Update: {
          artist_id?: string
          budget?: number | null
          created_at?: string
          deadline?: string | null
          description?: string
          id?: string
          notes?: string | null
          requester_id?: string
          service_type?: string
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_service_requests_artist_id_fkey"
            columns: ["artist_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ethos_service_requests_requester_id_fkey"
            columns: ["requester_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_tracks: {
        Row: {
          bpm: number | null
          created_at: string
          description: string | null
          download_count: number
          duration_seconds: number | null
          file_url: string
          genre: string[] | null
          id: string
          is_published: boolean
          license_type: string
          price: number | null
          rating: number | null
          title: string
          updated_at: string
          user_id: string
        }
        Insert: {
          bpm?: number | null
          created_at?: string
          description?: string | null
          download_count?: number
          duration_seconds?: number | null
          file_url: string
          genre?: string[] | null
          id?: string
          is_published?: boolean
          license_type?: string
          price?: number | null
          rating?: number | null
          title: string
          updated_at?: string
          user_id: string
        }
        Update: {
          bpm?: number | null
          created_at?: string
          description?: string | null
          download_count?: number
          duration_seconds?: number | null
          file_url?: string
          genre?: string[] | null
          id?: string
          is_published?: boolean
          license_type?: string
          price?: number | null
          rating?: number | null
          title?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_tracks_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_verification_audit_log: {
        Row: {
          action: string
          actor_id: string | null
          created_at: string
          id: string
          notes: string | null
          request_id: string
        }
        Insert: {
          action: string
          actor_id?: string | null
          created_at?: string
          id?: string
          notes?: string | null
          request_id: string
        }
        Update: {
          action?: string
          actor_id?: string | null
          created_at?: string
          id?: string
          notes?: string | null
          request_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_verification_audit_log_actor_id_fkey"
            columns: ["actor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ethos_verification_audit_log_request_id_fkey"
            columns: ["request_id"]
            isOneToOne: false
            referencedRelation: "ethos_verification_requests"
            referencedColumns: ["id"]
          },
        ]
      }
      ethos_verification_requests: {
        Row: {
          artist_profile_id: string
          created_at: string
          id: string
          portfolio_links: string[] | null
          rejection_reason: string | null
          reviewed_at: string | null
          reviewed_by: string | null
          status: string
          submission_notes: string | null
          submitted_at: string
          updated_at: string
          user_id: string
        }
        Insert: {
          artist_profile_id: string
          created_at?: string
          id?: string
          portfolio_links?: string[] | null
          rejection_reason?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          submission_notes?: string | null
          submitted_at?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          artist_profile_id?: string
          created_at?: string
          id?: string
          portfolio_links?: string[] | null
          rejection_reason?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string
          submission_notes?: string | null
          submitted_at?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "ethos_verification_requests_artist_profile_id_fkey"
            columns: ["artist_profile_id"]
            isOneToOne: false
            referencedRelation: "ethos_artist_profiles"
            referencedColumns: ["user_id"]
          },
          {
            foreignKeyName: "ethos_verification_requests_reviewed_by_fkey"
            columns: ["reviewed_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "ethos_verification_requests_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      experiences: {
        Row: {
          banner_url: string | null
          created_at: string | null
          creator_group_id: string | null
          creator_user_id: string | null
          description: string | null
          id: string
          is_published: boolean | null
          max_players: number | null
          player_count: number | null
          roblox_place_id: number | null
          server_size: number | null
          slug: string | null
          status: string | null
          tags: string[] | null
          thumbnail_url: string | null
          title: string
          updated_at: string | null
          version: string | null
        }
        Insert: {
          banner_url?: string | null
          created_at?: string | null
          creator_group_id?: string | null
          creator_user_id?: string | null
          description?: string | null
          id?: string
          is_published?: boolean | null
          max_players?: number | null
          player_count?: number | null
          roblox_place_id?: number | null
          server_size?: number | null
          slug?: string | null
          status?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title: string
          updated_at?: string | null
          version?: string | null
        }
        Update: {
          banner_url?: string | null
          created_at?: string | null
          creator_group_id?: string | null
          creator_user_id?: string | null
          description?: string | null
          id?: string
          is_published?: boolean | null
          max_players?: number | null
          player_count?: number | null
          roblox_place_id?: number | null
          server_size?: number | null
          slug?: string | null
          status?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title?: string
          updated_at?: string | null
          version?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "experiences_creator_group_id_fkey"
            columns: ["creator_group_id"]
            isOneToOne: false
            referencedRelation: "groups"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "experiences_creator_id_fkey"
            columns: ["creator_user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      fan_art: {
        Row: {
          created_at: string
          description: string | null
          id: string
          image_url: string
          is_approved: boolean | null
          is_featured: boolean
          site_id: string | null
          title: string
          user_id: string | null
          username: string | null
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          image_url: string
          is_approved?: boolean | null
          is_featured?: boolean
          site_id?: string | null
          title: string
          user_id?: string | null
          username?: string | null
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          image_url?: string
          is_approved?: boolean | null
          is_featured?: boolean
          site_id?: string | null
          title?: string
          user_id?: string | null
          username?: string | null
        }
        Relationships: []
      }
      faqs: {
        Row: {
          answer: string
          category: string | null
          created_at: string
          display_order: number | null
          id: string
          question: string
          site_id: string
        }
        Insert: {
          answer: string
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          question: string
          site_id: string
        }
        Update: {
          answer?: string
          category?: string | null
          created_at?: string
          display_order?: number | null
          id?: string
          question?: string
          site_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "fk_site"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_site"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      feature_limits: {
        Row: {
          analytics_enabled: boolean | null
          created_at: string | null
          custom_branding: boolean | null
          dedicated_infrastructure: boolean | null
          id: string
          max_friends: number | null
          max_storage_gb: number | null
          max_video_quality: string | null
          priority_support: boolean | null
          tier: string
          video_calls_enabled: boolean | null
          voice_calls_enabled: boolean | null
          white_label: boolean | null
        }
        Insert: {
          analytics_enabled?: boolean | null
          created_at?: string | null
          custom_branding?: boolean | null
          dedicated_infrastructure?: boolean | null
          id?: string
          max_friends?: number | null
          max_storage_gb?: number | null
          max_video_quality?: string | null
          priority_support?: boolean | null
          tier: string
          video_calls_enabled?: boolean | null
          voice_calls_enabled?: boolean | null
          white_label?: boolean | null
        }
        Update: {
          analytics_enabled?: boolean | null
          created_at?: string | null
          custom_branding?: boolean | null
          dedicated_infrastructure?: boolean | null
          id?: string
          max_friends?: number | null
          max_storage_gb?: number | null
          max_video_quality?: string | null
          priority_support?: boolean | null
          tier?: string
          video_calls_enabled?: boolean | null
          voice_calls_enabled?: boolean | null
          white_label?: boolean | null
        }
        Relationships: []
      }
      featured_studios: {
        Row: {
          created_at: string | null
          id: number
          metrics: string | null
          name: string
          rank: number | null
          specialties: string[] | null
          tagline: string | null
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          id?: number
          metrics?: string | null
          name: string
          rank?: number | null
          specialties?: string[] | null
          tagline?: string | null
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          id?: number
          metrics?: string | null
          name?: string
          rank?: number | null
          specialties?: string[] | null
          tagline?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      federation_applications: {
        Row: {
          created_at: string | null
          guild_icon: string | null
          guild_id: string
          guild_name: string | null
          id: number
          member_count: number | null
          owner_id: string | null
          reason: string | null
          reviewed_at: string | null
          reviewed_by: string | null
          status: string | null
        }
        Insert: {
          created_at?: string | null
          guild_icon?: string | null
          guild_id: string
          guild_name?: string | null
          id?: number
          member_count?: number | null
          owner_id?: string | null
          reason?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string | null
        }
        Update: {
          created_at?: string | null
          guild_icon?: string | null
          guild_id?: string
          guild_name?: string | null
          id?: number
          member_count?: number | null
          owner_id?: string | null
          reason?: string | null
          reviewed_at?: string | null
          reviewed_by?: string | null
          status?: string | null
        }
        Relationships: []
      }
      federation_bans: {
        Row: {
          active: boolean | null
          created_at: string | null
          evidence: string | null
          id: number
          reason: string | null
          reported_by: string | null
          reported_by_guild_id: string | null
          severity: string | null
          updated_at: string | null
          user_id: string
          username: string | null
        }
        Insert: {
          active?: boolean | null
          created_at?: string | null
          evidence?: string | null
          id?: number
          reason?: string | null
          reported_by?: string | null
          reported_by_guild_id?: string | null
          severity?: string | null
          updated_at?: string | null
          user_id: string
          username?: string | null
        }
        Update: {
          active?: boolean | null
          created_at?: string | null
          evidence?: string | null
          id?: number
          reason?: string | null
          reported_by?: string | null
          reported_by_guild_id?: string | null
          severity?: string | null
          updated_at?: string | null
          user_id?: string
          username?: string | null
        }
        Relationships: []
      }
      federation_featured: {
        Row: {
          active: boolean | null
          created_at: string | null
          expires_at: string | null
          guild_id: string
          id: number
          subscription_id: string | null
        }
        Insert: {
          active?: boolean | null
          created_at?: string | null
          expires_at?: string | null
          guild_id: string
          id?: number
          subscription_id?: string | null
        }
        Update: {
          active?: boolean | null
          created_at?: string | null
          expires_at?: string | null
          guild_id?: string
          id?: number
          subscription_id?: string | null
        }
        Relationships: []
      }
      federation_mappings: {
        Row: {
          guild_id: string | null
          guild_name: string | null
          linked_at: string | null
          role_id: string
          role_name: string | null
        }
        Insert: {
          guild_id?: string | null
          guild_name?: string | null
          linked_at?: string | null
          role_id: string
          role_name?: string | null
        }
        Update: {
          guild_id?: string | null
          guild_name?: string | null
          linked_at?: string | null
          role_id?: string
          role_name?: string | null
        }
        Relationships: []
      }
      federation_reputation: {
        Row: {
          false_positives: number | null
          guild_id: string
          id: number
          last_updated: string | null
          total_reports: number | null
          valid_reports: number | null
        }
        Insert: {
          false_positives?: number | null
          guild_id: string
          id?: number
          last_updated?: string | null
          total_reports?: number | null
          valid_reports?: number | null
        }
        Update: {
          false_positives?: number | null
          guild_id?: string
          id?: number
          last_updated?: string | null
          total_reports?: number | null
          valid_reports?: number | null
        }
        Relationships: []
      }
      federation_servers: {
        Row: {
          created_at: string | null
          description: string | null
          guild_icon: string | null
          guild_id: string
          guild_name: string | null
          id: number
          invite_code: string | null
          joined_federation_at: string | null
          member_count: number | null
          owner_id: string | null
          reputation_score: number | null
          status: string | null
          subscription_id: string | null
          subscription_status: string | null
          tier: string | null
          trust_level: string | null
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          guild_icon?: string | null
          guild_id: string
          guild_name?: string | null
          id?: number
          invite_code?: string | null
          joined_federation_at?: string | null
          member_count?: number | null
          owner_id?: string | null
          reputation_score?: number | null
          status?: string | null
          subscription_id?: string | null
          subscription_status?: string | null
          tier?: string | null
          trust_level?: string | null
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          guild_icon?: string | null
          guild_id?: string
          guild_name?: string | null
          id?: number
          invite_code?: string | null
          joined_federation_at?: string | null
          member_count?: number | null
          owner_id?: string | null
          reputation_score?: number | null
          status?: string | null
          subscription_id?: string | null
          subscription_status?: string | null
          tier?: string | null
          trust_level?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      feedback: {
        Row: {
          created_at: number
          data: Json | null
          id: string
          meta: Json | null
          snapshot: Json | null
          type: string | null
          updated_at: number
          user_id: string | null
          version: number | null
        }
        Insert: {
          created_at: number
          data?: Json | null
          id: string
          meta?: Json | null
          snapshot?: Json | null
          type?: string | null
          updated_at: number
          user_id?: string | null
          version?: number | null
        }
        Update: {
          created_at?: number
          data?: Json | null
          id?: string
          meta?: Json | null
          snapshot?: Json | null
          type?: string | null
          updated_at?: number
          user_id?: string | null
          version?: number | null
        }
        Relationships: []
      }
      feedback_surveys: {
        Row: {
          created_at: string | null
          description: string | null
          id: string
          is_active: boolean | null
          questions: Json | null
          site_id: string
          title: string
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          id?: string
          is_active?: boolean | null
          questions?: Json | null
          site_id: string
          title: string
        }
        Update: {
          created_at?: string | null
          description?: string | null
          id?: string
          is_active?: boolean | null
          questions?: Json | null
          site_id?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "feedback_surveys_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "feedback_surveys_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      file: {
        Row: {
          created_at: number
          data: Json | null
          filename: string
          hash: string | null
          id: string
          meta: Json | null
          path: string | null
          updated_at: number | null
          user_id: string
        }
        Insert: {
          created_at: number
          data?: Json | null
          filename: string
          hash?: string | null
          id: string
          meta?: Json | null
          path?: string | null
          updated_at?: number | null
          user_id: string
        }
        Update: {
          created_at?: number
          data?: Json | null
          filename?: string
          hash?: string | null
          id?: string
          meta?: Json | null
          path?: string | null
          updated_at?: number | null
          user_id?: string
        }
        Relationships: []
      }
      files: {
        Row: {
          content: string | null
          conversation_id: string | null
          created_at: string | null
          id: string
          is_folder: boolean | null
          language: string | null
          name: string
          parent_id: string | null
          path: string
          size: number | null
          updated_at: string | null
          uploader_id: string | null
          user_id: string
        }
        Insert: {
          content?: string | null
          conversation_id?: string | null
          created_at?: string | null
          id: string
          is_folder?: boolean | null
          language?: string | null
          name: string
          parent_id?: string | null
          path: string
          size?: number | null
          updated_at?: string | null
          uploader_id?: string | null
          user_id: string
        }
        Update: {
          content?: string | null
          conversation_id?: string | null
          created_at?: string | null
          id?: string
          is_folder?: boolean | null
          language?: string | null
          name?: string
          parent_id?: string | null
          path?: string
          size?: number | null
          updated_at?: string | null
          uploader_id?: string | null
          user_id?: string
        }
        Relationships: []
      }
      flash_event_participants: {
        Row: {
          event_id: string
          finished_at: string | null
          id: string
          joined_at: string
          rank: number | null
          score: number
          user_id: string
          username: string
        }
        Insert: {
          event_id: string
          finished_at?: string | null
          id?: string
          joined_at?: string
          rank?: number | null
          score?: number
          user_id: string
          username: string
        }
        Update: {
          event_id?: string
          finished_at?: string | null
          id?: string
          joined_at?: string
          rank?: number | null
          score?: number
          user_id?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "flash_event_participants_event_id_fkey"
            columns: ["event_id"]
            isOneToOne: false
            referencedRelation: "flash_events"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "flash_event_participants_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      flash_events: {
        Row: {
          channel_id: string | null
          config: Json | null
          created_at: string
          description: string | null
          duration_minutes: number
          ends_at: string
          event_type: string
          guild_id: string | null
          id: string
          starts_at: string
          status: string
          title: string
          updated_at: string
          winner_score: number | null
          winner_user_id: string | null
          winner_username: string | null
          xp_prize: number
        }
        Insert: {
          channel_id?: string | null
          config?: Json | null
          created_at?: string
          description?: string | null
          duration_minutes?: number
          ends_at: string
          event_type: string
          guild_id?: string | null
          id?: string
          starts_at: string
          status?: string
          title: string
          updated_at?: string
          winner_score?: number | null
          winner_user_id?: string | null
          winner_username?: string | null
          xp_prize?: number
        }
        Update: {
          channel_id?: string | null
          config?: Json | null
          created_at?: string
          description?: string | null
          duration_minutes?: number
          ends_at?: string
          event_type?: string
          guild_id?: string | null
          id?: string
          starts_at?: string
          status?: string
          title?: string
          updated_at?: string
          winner_score?: number | null
          winner_user_id?: string | null
          winner_username?: string | null
          xp_prize?: number
        }
        Relationships: [
          {
            foreignKeyName: "flash_events_winner_user_id_fkey"
            columns: ["winner_user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      folder: {
        Row: {
          created_at: number
          data: Json | null
          id: string
          is_expanded: boolean
          items: Json | null
          meta: Json | null
          name: string
          parent_id: string | null
          updated_at: number
          user_id: string
        }
        Insert: {
          created_at: number
          data?: Json | null
          id: string
          is_expanded: boolean
          items?: Json | null
          meta?: Json | null
          name: string
          parent_id?: string | null
          updated_at: number
          user_id: string
        }
        Update: {
          created_at?: number
          data?: Json | null
          id?: string
          is_expanded?: boolean
          items?: Json | null
          meta?: Json | null
          name?: string
          parent_id?: string | null
          updated_at?: number
          user_id?: string
        }
        Relationships: []
      }
      followers: {
        Row: {
          created_at: string
          follower_id: string
          following_id: string
          id: string
        }
        Insert: {
          created_at?: string
          follower_id: string
          following_id: string
          id?: string
        }
        Update: {
          created_at?: string
          follower_id?: string
          following_id?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "followers_follower_id_fkey"
            columns: ["follower_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "followers_following_id_fkey"
            columns: ["following_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_categories: {
        Row: {
          description: string | null
          display_order: number | null
          id: string
          name: string
          site_id: string | null
          slug: string | null
        }
        Insert: {
          description?: string | null
          display_order?: number | null
          id?: string
          name: string
          site_id?: string | null
          slug?: string | null
        }
        Update: {
          description?: string | null
          display_order?: number | null
          id?: string
          name?: string
          site_id?: string | null
          slug?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "forum_categories_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_categories_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      forum_comments: {
        Row: {
          content: string | null
          created_at: string | null
          id: string
          parent_comment_id: string | null
          post_id: string | null
          user_id: string | null
        }
        Insert: {
          content?: string | null
          created_at?: string | null
          id?: string
          parent_comment_id?: string | null
          post_id?: string | null
          user_id?: string | null
        }
        Update: {
          content?: string | null
          created_at?: string | null
          id?: string
          parent_comment_id?: string | null
          post_id?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "forum_comments_parent_comment_id_fkey"
            columns: ["parent_comment_id"]
            isOneToOne: false
            referencedRelation: "forum_comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_comments_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "forum_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_comments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_likes: {
        Row: {
          comment_id: string | null
          created_at: string | null
          id: string
          post_id: string | null
          reaction_type: string | null
          user_id: string | null
        }
        Insert: {
          comment_id?: string | null
          created_at?: string | null
          id?: string
          post_id?: string | null
          reaction_type?: string | null
          user_id?: string | null
        }
        Update: {
          comment_id?: string | null
          created_at?: string | null
          id?: string
          post_id?: string | null
          reaction_type?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "forum_likes_comment_id_fkey"
            columns: ["comment_id"]
            isOneToOne: false
            referencedRelation: "forum_comments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "forum_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_post_tags: {
        Row: {
          post_id: string
          tag_id: string
        }
        Insert: {
          post_id: string
          tag_id: string
        }
        Update: {
          post_id?: string
          tag_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "forum_post_tags_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "forum_posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_post_tags_tag_id_fkey"
            columns: ["tag_id"]
            isOneToOne: false
            referencedRelation: "forum_tags"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_posts: {
        Row: {
          category_id: string | null
          content: string | null
          created_at: string | null
          id: string
          last_activity_at: string | null
          site_id: string | null
          slug: string | null
          title: string
          updated_at: string | null
          user_id: string | null
          views_count: number | null
        }
        Insert: {
          category_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          last_activity_at?: string | null
          site_id?: string | null
          slug?: string | null
          title: string
          updated_at?: string | null
          user_id?: string | null
          views_count?: number | null
        }
        Update: {
          category_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          last_activity_at?: string | null
          site_id?: string | null
          slug?: string | null
          title?: string
          updated_at?: string | null
          user_id?: string | null
          views_count?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "forum_posts_category_id_fkey"
            columns: ["category_id"]
            isOneToOne: false
            referencedRelation: "forum_categories"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_posts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "forum_posts_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "forum_posts_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_replies: {
        Row: {
          author_id: string | null
          author_name: string | null
          content: string
          created_at: string | null
          id: string
          is_solution: boolean | null
          likes: number | null
          thread_id: string | null
        }
        Insert: {
          author_id?: string | null
          author_name?: string | null
          content: string
          created_at?: string | null
          id?: string
          is_solution?: boolean | null
          likes?: number | null
          thread_id?: string | null
        }
        Update: {
          author_id?: string | null
          author_name?: string | null
          content?: string
          created_at?: string | null
          id?: string
          is_solution?: boolean | null
          likes?: number | null
          thread_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "forum_replies_thread_id_fkey"
            columns: ["thread_id"]
            isOneToOne: false
            referencedRelation: "forum_threads"
            referencedColumns: ["id"]
          },
        ]
      }
      forum_tags: {
        Row: {
          created_at: string | null
          description: string | null
          id: string
          name: string
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          id?: string
          name: string
        }
        Update: {
          created_at?: string | null
          description?: string | null
          id?: string
          name?: string
        }
        Relationships: []
      }
      forum_threads: {
        Row: {
          author_avatar: string | null
          author_id: string | null
          author_name: string | null
          category_id: string | null
          content: string | null
          created_at: string | null
          id: string
          is_hot: boolean | null
          is_solved: boolean | null
          last_reply_at: string | null
          likes: number | null
          pinned: boolean | null
          reply_count: number | null
          tags: string[] | null
          title: string
          views: number | null
        }
        Insert: {
          author_avatar?: string | null
          author_id?: string | null
          author_name?: string | null
          category_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          is_hot?: boolean | null
          is_solved?: boolean | null
          last_reply_at?: string | null
          likes?: number | null
          pinned?: boolean | null
          reply_count?: number | null
          tags?: string[] | null
          title: string
          views?: number | null
        }
        Update: {
          author_avatar?: string | null
          author_id?: string | null
          author_name?: string | null
          category_id?: string | null
          content?: string | null
          created_at?: string | null
          id?: string
          is_hot?: boolean | null
          is_solved?: boolean | null
          last_reply_at?: string | null
          likes?: number | null
          pinned?: boolean | null
          reply_count?: number | null
          tags?: string[] | null
          title?: string
          views?: number | null
        }
        Relationships: []
      }
      foundation_achievements: {
        Row: {
          badge_color: string | null
          created_at: string
          description: string | null
          icon_url: string | null
          id: string
          name: string
          requirement_data: Json | null
          requirement_type: string
          slug: string
          tier: number | null
          updated_at: string
        }
        Insert: {
          badge_color?: string | null
          created_at?: string
          description?: string | null
          icon_url?: string | null
          id?: string
          name: string
          requirement_data?: Json | null
          requirement_type: string
          slug: string
          tier?: number | null
          updated_at?: string
        }
        Update: {
          badge_color?: string | null
          created_at?: string
          description?: string | null
          icon_url?: string | null
          id?: string
          name?: string
          requirement_data?: Json | null
          requirement_type?: string
          slug?: string
          tier?: number | null
          updated_at?: string
        }
        Relationships: []
      }
      foundation_activity: {
        Row: {
          action: string | null
          created_at: string | null
          id: number
          member_id: string | null
          points: number | null
        }
        Insert: {
          action?: string | null
          created_at?: string | null
          id?: number
          member_id?: string | null
          points?: number | null
        }
        Update: {
          action?: string | null
          created_at?: string | null
          id?: number
          member_id?: string | null
          points?: number | null
        }
        Relationships: []
      }
      foundation_contributions: {
        Row: {
          amount: number | null
          contribution_type: string | null
          contributor_id: string | null
          created_at: string | null
          description: string | null
          id: number
          points: number
          resource_id: string | null
          type: string | null
          user_id: string | null
        }
        Insert: {
          amount?: number | null
          contribution_type?: string | null
          contributor_id?: string | null
          created_at?: string | null
          description?: string | null
          id?: number
          points?: number
          resource_id?: string | null
          type?: string | null
          user_id?: string | null
        }
        Update: {
          amount?: number | null
          contribution_type?: string | null
          contributor_id?: string | null
          created_at?: string | null
          description?: string | null
          id?: number
          points?: number
          resource_id?: string | null
          type?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_contributions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_course_content: {
        Row: {
          chapter_count: number | null
          content_type: string
          content_url: string | null
          course_id: string
          created_at: string | null
          download_count: number | null
          file_size_kb: number | null
          id: string
          title: string
          updated_at: string | null
        }
        Insert: {
          chapter_count?: number | null
          content_type: string
          content_url?: string | null
          course_id: string
          created_at?: string | null
          download_count?: number | null
          file_size_kb?: number | null
          id?: string
          title: string
          updated_at?: string | null
        }
        Update: {
          chapter_count?: number | null
          content_type?: string
          content_url?: string | null
          course_id?: string
          created_at?: string | null
          download_count?: number | null
          file_size_kb?: number | null
          id?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_course_content_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "foundation_courses"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_course_lessons: {
        Row: {
          content: string
          course_id: string
          created_at: string
          id: string
          is_published: boolean
          module_id: string
          order_index: number
          reading_time_minutes: number | null
          title: string
          updated_at: string
          video_url: string | null
        }
        Insert: {
          content: string
          course_id: string
          created_at?: string
          id?: string
          is_published?: boolean
          module_id: string
          order_index: number
          reading_time_minutes?: number | null
          title: string
          updated_at?: string
          video_url?: string | null
        }
        Update: {
          content?: string
          course_id?: string
          created_at?: string
          id?: string
          is_published?: boolean
          module_id?: string
          order_index?: number
          reading_time_minutes?: number | null
          title?: string
          updated_at?: string
          video_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_course_lessons_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "foundation_courses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_course_lessons_module_id_fkey"
            columns: ["module_id"]
            isOneToOne: false
            referencedRelation: "foundation_course_modules"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_course_materials: {
        Row: {
          content: string
          course_id: string
          created_at: string | null
          download_count: number | null
          file_size_kb: number | null
          format: string
          id: string
          title: string
          updated_at: string | null
        }
        Insert: {
          content: string
          course_id: string
          created_at?: string | null
          download_count?: number | null
          file_size_kb?: number | null
          format: string
          id?: string
          title: string
          updated_at?: string | null
        }
        Update: {
          content?: string
          course_id?: string
          created_at?: string | null
          download_count?: number | null
          file_size_kb?: number | null
          format?: string
          id?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_course_materials_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "foundation_courses"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_course_modules: {
        Row: {
          content: string | null
          course_id: string
          created_at: string
          description: string | null
          id: string
          is_published: boolean
          order_index: number
          title: string
          updated_at: string
          video_url: string | null
        }
        Insert: {
          content?: string | null
          course_id: string
          created_at?: string
          description?: string | null
          id?: string
          is_published?: boolean
          order_index: number
          title: string
          updated_at?: string
          video_url?: string | null
        }
        Update: {
          content?: string | null
          course_id?: string
          created_at?: string
          description?: string | null
          id?: string
          is_published?: boolean
          order_index?: number
          title?: string
          updated_at?: string
          video_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_course_modules_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "foundation_courses"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_courses: {
        Row: {
          category: string
          content: string | null
          cover_image_url: string | null
          created_at: string | null
          description: string
          difficulty: string
          estimated_hours: number | null
          id: string
          instructor_id: string | null
          is_published: boolean | null
          slug: string
          title: string
          updated_at: string | null
        }
        Insert: {
          category: string
          content?: string | null
          cover_image_url?: string | null
          created_at?: string | null
          description: string
          difficulty: string
          estimated_hours?: number | null
          id?: string
          instructor_id?: string | null
          is_published?: boolean | null
          slug: string
          title: string
          updated_at?: string | null
        }
        Update: {
          category?: string
          content?: string | null
          cover_image_url?: string | null
          created_at?: string | null
          description?: string
          difficulty?: string
          estimated_hours?: number | null
          id?: string
          instructor_id?: string | null
          is_published?: boolean | null
          slug?: string
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "foundation_courses_instructor_id_fkey"
            columns: ["instructor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_enrollments: {
        Row: {
          completed_at: string | null
          course_id: string
          enrolled_at: string
          id: string
          progress_percent: number
          status: string
          updated_at: string
          user_id: string
        }
        Insert: {
          completed_at?: string | null
          course_id: string
          enrolled_at?: string
          id?: string
          progress_percent?: number
          status?: string
          updated_at?: string
          user_id: string
        }
        Update: {
          completed_at?: string | null
          course_id?: string
          enrolled_at?: string
          id?: string
          progress_percent?: number
          status?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_enrollments_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "foundation_courses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_enrollments_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_lesson_progress: {
        Row: {
          completed: boolean
          completed_at: string | null
          created_at: string
          lesson_id: string
          user_id: string
        }
        Insert: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          lesson_id: string
          user_id: string
        }
        Update: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          lesson_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_lesson_progress_lesson_id_fkey"
            columns: ["lesson_id"]
            isOneToOne: false
            referencedRelation: "foundation_course_lessons"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_lesson_progress_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_mentors: {
        Row: {
          approval_status: string
          approved_at: string | null
          approved_by: string | null
          available: boolean
          bio: string | null
          created_at: string
          current_mentees: number
          expertise: string[]
          max_mentees: number | null
          updated_at: string
          user_id: string
        }
        Insert: {
          approval_status?: string
          approved_at?: string | null
          approved_by?: string | null
          available?: boolean
          bio?: string | null
          created_at?: string
          current_mentees?: number
          expertise?: string[]
          max_mentees?: number | null
          updated_at?: string
          user_id: string
        }
        Update: {
          approval_status?: string
          approved_at?: string | null
          approved_by?: string | null
          available?: boolean
          bio?: string | null
          created_at?: string
          current_mentees?: number
          expertise?: string[]
          max_mentees?: number | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_mentors_approved_by_fkey"
            columns: ["approved_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_mentors_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_mentorship_requests: {
        Row: {
          created_at: string
          expertise_area: string | null
          id: string
          mentee_id: string
          mentor_id: string
          message: string | null
          status: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          expertise_area?: string | null
          id?: string
          mentee_id: string
          mentor_id: string
          message?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          expertise_area?: string | null
          id?: string
          mentee_id?: string
          mentor_id?: string
          message?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_mentorship_requests_mentee_id_fkey"
            columns: ["mentee_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_mentorship_requests_mentor_id_fkey"
            columns: ["mentor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_mentorship_sessions: {
        Row: {
          completed: boolean
          completed_at: string | null
          created_at: string
          duration_minutes: number
          id: string
          mentee_id: string
          mentor_id: string
          notes: string | null
          scheduled_at: string
          topic: string | null
          updated_at: string
        }
        Insert: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          duration_minutes?: number
          id?: string
          mentee_id: string
          mentor_id: string
          notes?: string | null
          scheduled_at: string
          topic?: string | null
          updated_at?: string
        }
        Update: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          duration_minutes?: number
          id?: string
          mentee_id?: string
          mentor_id?: string
          notes?: string | null
          scheduled_at?: string
          topic?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_mentorship_sessions_mentee_id_fkey"
            columns: ["mentee_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_mentorship_sessions_mentor_id_fkey"
            columns: ["mentor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      foundation_user_achievements: {
        Row: {
          achievement_id: string
          earned_at: string
          id: string
          user_id: string
        }
        Insert: {
          achievement_id: string
          earned_at?: string
          id?: string
          user_id: string
        }
        Update: {
          achievement_id?: string
          earned_at?: string
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "foundation_user_achievements_achievement_id_fkey"
            columns: ["achievement_id"]
            isOneToOne: false
            referencedRelation: "foundation_achievements"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "foundation_user_achievements_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      fourthwall_orders: {
        Row: {
          created_at: string | null
          customer_email: string
          fourthwall_order_id: string
          id: number
          items: Json | null
          paid_at: string | null
          status: string
          total_amount: number
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          customer_email: string
          fourthwall_order_id: string
          id?: number
          items?: Json | null
          paid_at?: string | null
          status?: string
          total_amount: number
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          customer_email?: string
          fourthwall_order_id?: string
          id?: number
          items?: Json | null
          paid_at?: string | null
          status?: string
          total_amount?: number
          updated_at?: string | null
        }
        Relationships: []
      }
      fourthwall_products: {
        Row: {
          category: string | null
          created_at: string | null
          currency: string
          description: string | null
          fourthwall_id: string
          id: number
          image_url: string | null
          name: string
          price: number
          synced_at: string | null
          updated_at: string | null
        }
        Insert: {
          category?: string | null
          created_at?: string | null
          currency?: string
          description?: string | null
          fourthwall_id: string
          id?: number
          image_url?: string | null
          name: string
          price: number
          synced_at?: string | null
          updated_at?: string | null
        }
        Update: {
          category?: string | null
          created_at?: string | null
          currency?: string
          description?: string | null
          fourthwall_id?: string
          id?: number
          image_url?: string | null
          name?: string
          price?: number
          synced_at?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      fourthwall_webhook_logs: {
        Row: {
          event_type: string
          id: number
          payload: Json | null
          received_at: string | null
        }
        Insert: {
          event_type: string
          id?: number
          payload?: Json | null
          received_at?: string | null
        }
        Update: {
          event_type?: string
          id?: number
          payload?: Json | null
          received_at?: string | null
        }
        Relationships: []
      }
      friend_requests: {
        Row: {
          created_at: string | null
          from_user_id: string
          id: string
          responded_at: string | null
          status: string | null
          to_user_id: string
        }
        Insert: {
          created_at?: string | null
          from_user_id: string
          id?: string
          responded_at?: string | null
          status?: string | null
          to_user_id: string
        }
        Update: {
          created_at?: string | null
          from_user_id?: string
          id?: string
          responded_at?: string | null
          status?: string | null
          to_user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "friend_requests_from_user_id_fkey"
            columns: ["from_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "friend_requests_to_user_id_fkey"
            columns: ["to_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      friendships: {
        Row: {
          created_at: string | null
          id: string
          user1_id: string
          user2_id: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          user1_id: string
          user2_id: string
        }
        Update: {
          created_at?: string | null
          id?: string
          user1_id?: string
          user2_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "friendships_user1_id_fkey"
            columns: ["user1_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "friendships_user2_id_fkey"
            columns: ["user2_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      function: {
        Row: {
          content: string
          created_at: number
          id: string
          is_active: boolean
          is_global: boolean
          meta: string
          name: string
          type: string
          updated_at: number
          user_id: string
          valves: string | null
        }
        Insert: {
          content: string
          created_at: number
          id: string
          is_active: boolean
          is_global: boolean
          meta: string
          name: string
          type: string
          updated_at: number
          user_id: string
          valves?: string | null
        }
        Update: {
          content?: string
          created_at?: number
          id?: string
          is_active?: boolean
          is_global?: boolean
          meta?: string
          name?: string
          type?: string
          updated_at?: number
          user_id?: string
          valves?: string | null
        }
        Relationships: []
      }
      game_achievements: {
        Row: {
          description: string | null
          game_id: string | null
          icon: string | null
          id: string
          name: string
          points: number | null
          roblox_badge_id: number | null
        }
        Insert: {
          description?: string | null
          game_id?: string | null
          icon?: string | null
          id?: string
          name: string
          points?: number | null
          roblox_badge_id?: number | null
        }
        Update: {
          description?: string | null
          game_id?: string | null
          icon?: string | null
          id?: string
          name?: string
          points?: number | null
          roblox_badge_id?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "game_achievements_game_id_fkey"
            columns: ["game_id"]
            isOneToOne: false
            referencedRelation: "games"
            referencedColumns: ["id"]
          },
        ]
      }
      game_auth_tokens: {
        Row: {
          created_at: string | null
          expires_at: string
          game: string
          id: string
          last_used: string | null
          metadata: Json | null
          player_token: string | null
          token: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          expires_at: string
          game: string
          id?: string
          last_used?: string | null
          metadata?: Json | null
          player_token?: string | null
          token: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          expires_at?: string
          game?: string
          id?: string
          last_used?: string | null
          metadata?: Json | null
          player_token?: string | null
          token?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "game_auth_tokens_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      game_lobbies: {
        Row: {
          conversation_id: string | null
          created_at: string | null
          ended_at: string | null
          game_id: string
          host_user_id: string
          id: string
          is_public: boolean | null
          lobby_code: string | null
          max_players: number | null
          started_at: string | null
          status: string | null
        }
        Insert: {
          conversation_id?: string | null
          created_at?: string | null
          ended_at?: string | null
          game_id: string
          host_user_id: string
          id?: string
          is_public?: boolean | null
          lobby_code?: string | null
          max_players?: number | null
          started_at?: string | null
          status?: string | null
        }
        Update: {
          conversation_id?: string | null
          created_at?: string | null
          ended_at?: string | null
          game_id?: string
          host_user_id?: string
          id?: string
          is_public?: boolean | null
          lobby_code?: string | null
          max_players?: number | null
          started_at?: string | null
          status?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "game_lobbies_conversation_id_fkey"
            columns: ["conversation_id"]
            isOneToOne: false
            referencedRelation: "conversations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "game_lobbies_host_user_id_fkey"
            columns: ["host_user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      game_lobby_participants: {
        Row: {
          id: string
          joined_at: string | null
          left_at: string | null
          lobby_id: string
          ready: boolean | null
          team_id: string | null
          user_id: string
        }
        Insert: {
          id?: string
          joined_at?: string | null
          left_at?: string | null
          lobby_id: string
          ready?: boolean | null
          team_id?: string | null
          user_id: string
        }
        Update: {
          id?: string
          joined_at?: string | null
          left_at?: string | null
          lobby_id?: string
          ready?: boolean | null
          team_id?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "game_lobby_participants_lobby_id_fkey"
            columns: ["lobby_id"]
            isOneToOne: false
            referencedRelation: "game_lobbies"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "game_lobby_participants_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      game_sessions: {
        Row: {
          created_at: string | null
          device_id: string | null
          expires_at: string
          game: string
          id: string
          last_activity: string | null
          nexus_player_id: string | null
          platform: string | null
          session_state: string | null
          session_token: string
          started_at: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          device_id?: string | null
          expires_at: string
          game: string
          id?: string
          last_activity?: string | null
          nexus_player_id?: string | null
          platform?: string | null
          session_state?: string | null
          session_token: string
          started_at?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          device_id?: string | null
          expires_at?: string
          game?: string
          id?: string
          last_activity?: string | null
          nexus_player_id?: string | null
          platform?: string | null
          session_state?: string | null
          session_token?: string
          started_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "game_sessions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_builds: {
        Row: {
          build_type: string
          changelog: string | null
          created_at: string
          created_by: string | null
          download_count: number
          download_url: string | null
          file_size: number | null
          id: string
          project_id: string
          release_date: string
          target_platforms: string[]
          updated_at: string
          version: string
        }
        Insert: {
          build_type: string
          changelog?: string | null
          created_at?: string
          created_by?: string | null
          download_count?: number
          download_url?: string | null
          file_size?: number | null
          id?: string
          project_id: string
          release_date?: string
          target_platforms?: string[]
          updated_at?: string
          version: string
        }
        Update: {
          build_type?: string
          changelog?: string | null
          created_at?: string
          created_by?: string | null
          download_count?: number
          download_url?: string | null
          file_size?: number | null
          id?: string
          project_id?: string
          release_date?: string
          target_platforms?: string[]
          updated_at?: string
          version?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_builds_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_builds_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "gameforge_projects"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_integrations: {
        Row: {
          auto_provision_channels: boolean | null
          channel_config: Json | null
          created_at: string | null
          domain: string
          id: string
          project_id: string
          updated_at: string | null
        }
        Insert: {
          auto_provision_channels?: boolean | null
          channel_config?: Json | null
          created_at?: string | null
          domain: string
          id?: string
          project_id: string
          updated_at?: string | null
        }
        Update: {
          auto_provision_channels?: boolean | null
          channel_config?: Json | null
          created_at?: string | null
          domain?: string
          id?: string
          project_id?: string
          updated_at?: string | null
        }
        Relationships: []
      }
      gameforge_metrics: {
        Row: {
          budget_allocated: number | null
          budget_spent: number | null
          bugs_fixed: number | null
          bugs_found: number | null
          build_count: number | null
          created_at: string
          days_from_planned_to_release: number | null
          hours_logged: number | null
          id: string
          metric_date: string
          metric_type: string
          on_schedule: boolean | null
          project_id: string
          team_size_avg: number | null
          velocity: number | null
        }
        Insert: {
          budget_allocated?: number | null
          budget_spent?: number | null
          bugs_fixed?: number | null
          bugs_found?: number | null
          build_count?: number | null
          created_at?: string
          days_from_planned_to_release?: number | null
          hours_logged?: number | null
          id?: string
          metric_date?: string
          metric_type: string
          on_schedule?: boolean | null
          project_id: string
          team_size_avg?: number | null
          velocity?: number | null
        }
        Update: {
          budget_allocated?: number | null
          budget_spent?: number | null
          bugs_fixed?: number | null
          bugs_found?: number | null
          build_count?: number | null
          created_at?: string
          days_from_planned_to_release?: number | null
          hours_logged?: number | null
          id?: string
          metric_date?: string
          metric_type?: string
          on_schedule?: boolean | null
          project_id?: string
          team_size_avg?: number | null
          velocity?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_metrics_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "gameforge_projects"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_projects: {
        Row: {
          actual_release_date: string | null
          budget: number | null
          created_at: string
          current_spend: number
          description: string | null
          documentation_url: string | null
          genre: string[]
          id: string
          lead_id: string
          name: string
          platform: string
          repository_url: string | null
          status: string
          target_release_date: string | null
          team_size: number | null
          updated_at: string
        }
        Insert: {
          actual_release_date?: string | null
          budget?: number | null
          created_at?: string
          current_spend?: number
          description?: string | null
          documentation_url?: string | null
          genre?: string[]
          id?: string
          lead_id: string
          name: string
          platform: string
          repository_url?: string | null
          status?: string
          target_release_date?: string | null
          team_size?: number | null
          updated_at?: string
        }
        Update: {
          actual_release_date?: string | null
          budget?: number | null
          created_at?: string
          current_spend?: number
          description?: string | null
          documentation_url?: string | null
          genre?: string[]
          id?: string
          lead_id?: string
          name?: string
          platform?: string
          repository_url?: string | null
          status?: string
          target_release_date?: string | null
          team_size?: number | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_projects_lead_id_fkey"
            columns: ["lead_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_sprint_members: {
        Row: {
          created_at: string
          id: string
          joined_at: string
          role: string
          sprint_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          joined_at?: string
          role?: string
          sprint_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          id?: string
          joined_at?: string
          role?: string
          sprint_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_sprint_members_sprint_id_fkey"
            columns: ["sprint_id"]
            isOneToOne: false
            referencedRelation: "gameforge_sprints"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_sprint_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_sprints: {
        Row: {
          actual_velocity: number | null
          created_at: string
          created_by: string
          description: string | null
          end_date: string | null
          goal: string | null
          id: string
          phase: string
          planned_velocity: number | null
          project_id: string
          sprint_number: number
          start_date: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          actual_velocity?: number | null
          created_at?: string
          created_by: string
          description?: string | null
          end_date?: string | null
          goal?: string | null
          id?: string
          phase?: string
          planned_velocity?: number | null
          project_id: string
          sprint_number: number
          start_date?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          actual_velocity?: number | null
          created_at?: string
          created_by?: string
          description?: string | null
          end_date?: string | null
          goal?: string | null
          id?: string
          phase?: string
          planned_velocity?: number | null
          project_id?: string
          sprint_number?: number
          start_date?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_sprints_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_sprints_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "gameforge_projects"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_tasks: {
        Row: {
          actual_hours: number | null
          assigned_to: string | null
          completed_at: string | null
          created_at: string
          created_by: string
          description: string | null
          due_date: string | null
          estimated_hours: number | null
          id: string
          priority: string
          project_id: string
          sprint_id: string | null
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          actual_hours?: number | null
          assigned_to?: string | null
          completed_at?: string | null
          created_at?: string
          created_by: string
          description?: string | null
          due_date?: string | null
          estimated_hours?: number | null
          id?: string
          priority?: string
          project_id: string
          sprint_id?: string | null
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          actual_hours?: number | null
          assigned_to?: string | null
          completed_at?: string | null
          created_at?: string
          created_by?: string
          description?: string | null
          due_date?: string | null
          estimated_hours?: number | null
          id?: string
          priority?: string
          project_id?: string
          sprint_id?: string | null
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_tasks_assigned_to_fkey"
            columns: ["assigned_to"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_tasks_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_tasks_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "gameforge_projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "gameforge_tasks_sprint_id_fkey"
            columns: ["sprint_id"]
            isOneToOne: false
            referencedRelation: "gameforge_sprints"
            referencedColumns: ["id"]
          },
        ]
      }
      gameforge_team_members: {
        Row: {
          bio: string | null
          contract_type: string
          created_at: string
          hourly_rate: number | null
          id: string
          is_active: boolean
          joined_date: string
          left_date: string | null
          position: string | null
          project_ids: string[]
          role: string
          skills: string[] | null
          updated_at: string
          user_id: string
        }
        Insert: {
          bio?: string | null
          contract_type?: string
          created_at?: string
          hourly_rate?: number | null
          id?: string
          is_active?: boolean
          joined_date?: string
          left_date?: string | null
          position?: string | null
          project_ids?: string[]
          role: string
          skills?: string[] | null
          updated_at?: string
          user_id: string
        }
        Update: {
          bio?: string | null
          contract_type?: string
          created_at?: string
          hourly_rate?: number | null
          id?: string
          is_active?: boolean
          joined_date?: string
          left_date?: string | null
          position?: string | null
          project_ids?: string[]
          role?: string
          skills?: string[] | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "gameforge_team_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      games: {
        Row: {
          api_endpoint: string | null
          arm: string | null
          created_at: string | null
          icon_url: string | null
          id: string
          name: string
          owner_id: string | null
          platform: string
          play_url: string | null
          slug: string
        }
        Insert: {
          api_endpoint?: string | null
          arm?: string | null
          created_at?: string | null
          icon_url?: string | null
          id?: string
          name: string
          owner_id?: string | null
          platform?: string
          play_url?: string | null
          slug: string
        }
        Update: {
          api_endpoint?: string | null
          arm?: string | null
          created_at?: string | null
          icon_url?: string | null
          id?: string
          name?: string
          owner_id?: string | null
          platform?: string
          play_url?: string | null
          slug?: string
        }
        Relationships: []
      }
      giveaways: {
        Row: {
          channel_id: string | null
          created_at: string | null
          end_time: string | null
          entries: Json | null
          guild_id: string | null
          host_id: string | null
          message_id: string
          prize: string | null
          required_role: string | null
          status: string | null
          winners_count: number | null
        }
        Insert: {
          channel_id?: string | null
          created_at?: string | null
          end_time?: string | null
          entries?: Json | null
          guild_id?: string | null
          host_id?: string | null
          message_id: string
          prize?: string | null
          required_role?: string | null
          status?: string | null
          winners_count?: number | null
        }
        Update: {
          channel_id?: string | null
          created_at?: string | null
          end_time?: string | null
          entries?: Json | null
          guild_id?: string | null
          host_id?: string | null
          message_id?: string
          prize?: string | null
          required_role?: string | null
          status?: string | null
          winners_count?: number | null
        }
        Relationships: []
      }
      goals: {
        Row: {
          created_at: string | null
          description: string | null
          due_date: string | null
          id: string
          progress: number | null
          site_id: string
          status: string | null
          title: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          progress?: number | null
          site_id: string
          status?: string | null
          title: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          description?: string | null
          due_date?: string | null
          id?: string
          progress?: number | null
          site_id?: string
          status?: string | null
          title?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "goals_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "goals_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "goals_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      grid_members: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string | null
          discord_id: string
          discord_username: string
          display_name: string | null
          id: string
          updated_at: string | null
          xp: number | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          discord_id: string
          discord_username: string
          display_name?: string | null
          id?: string
          updated_at?: string | null
          xp?: number | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          discord_id?: string
          discord_username?: string
          display_name?: string | null
          id?: string
          updated_at?: string | null
          xp?: number | null
        }
        Relationships: []
      }
      group: {
        Row: {
          created_at: number | null
          data: Json | null
          description: string | null
          id: string
          meta: Json | null
          name: string | null
          permissions: Json | null
          updated_at: number | null
          user_id: string | null
        }
        Insert: {
          created_at?: number | null
          data?: Json | null
          description?: string | null
          id: string
          meta?: Json | null
          name?: string | null
          permissions?: Json | null
          updated_at?: number | null
          user_id?: string | null
        }
        Update: {
          created_at?: number | null
          data?: Json | null
          description?: string | null
          id?: string
          meta?: Json | null
          name?: string | null
          permissions?: Json | null
          updated_at?: number | null
          user_id?: string | null
        }
        Relationships: []
      }
      group_member: {
        Row: {
          created_at: number | null
          group_id: string
          id: string
          updated_at: number | null
          user_id: string
        }
        Insert: {
          created_at?: number | null
          group_id: string
          id: string
          updated_at?: number | null
          user_id: string
        }
        Update: {
          created_at?: number | null
          group_id?: string
          id?: string
          updated_at?: number | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "group_member_group_id_fkey"
            columns: ["group_id"]
            isOneToOne: false
            referencedRelation: "group"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "group_member_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user"
            referencedColumns: ["id"]
          },
        ]
      }
      group_members: {
        Row: {
          group_id: string
          group_role_id: string | null
          id: string
          joined_at: string
          role: string
          user_id: string
        }
        Insert: {
          group_id: string
          group_role_id?: string | null
          id?: string
          joined_at?: string
          role?: string
          user_id: string
        }
        Update: {
          group_id?: string
          group_role_id?: string | null
          id?: string
          joined_at?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "group_members_group_id_fkey"
            columns: ["group_id"]
            isOneToOne: false
            referencedRelation: "groups"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "group_members_group_role_id_fkey"
            columns: ["group_role_id"]
            isOneToOne: false
            referencedRelation: "group_roles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "group_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      group_roles: {
        Row: {
          created_at: string | null
          group_id: string
          id: string
          name: string
          permissions: Json
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          group_id: string
          id?: string
          name: string
          permissions: Json
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          group_id?: string
          id?: string
          name?: string
          permissions?: Json
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "group_roles_group_id_fkey"
            columns: ["group_id"]
            isOneToOne: false
            referencedRelation: "groups"
            referencedColumns: ["id"]
          },
        ]
      }
      groups: {
        Row: {
          avatar_url: string | null
          banner_url: string | null
          created_at: string
          description: string | null
          id: string
          is_verified: boolean | null
          name: string
          owner_id: string
          slug: string
          updated_at: string
        }
        Insert: {
          avatar_url?: string | null
          banner_url?: string | null
          created_at?: string
          description?: string | null
          id?: string
          is_verified?: boolean | null
          name: string
          owner_id: string
          slug: string
          updated_at?: string
        }
        Update: {
          avatar_url?: string | null
          banner_url?: string | null
          created_at?: string
          description?: string | null
          id?: string
          is_verified?: boolean | null
          name?: string
          owner_id?: string
          slug?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "groups_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      guild_user_xp: {
        Row: {
          created_at: string | null
          guild_id: string
          id: number
          last_xp_at: string | null
          level: number | null
          messages: number | null
          prestige: number | null
          updated_at: string | null
          user_id: string
          voice_minutes: number | null
          xp: number | null
        }
        Insert: {
          created_at?: string | null
          guild_id: string
          id?: number
          last_xp_at?: string | null
          level?: number | null
          messages?: number | null
          prestige?: number | null
          updated_at?: string | null
          user_id: string
          voice_minutes?: number | null
          xp?: number | null
        }
        Update: {
          created_at?: string | null
          guild_id?: string
          id?: number
          last_xp_at?: string | null
          level?: number | null
          messages?: number | null
          prestige?: number | null
          updated_at?: string | null
          user_id?: string
          voice_minutes?: number | null
          xp?: number | null
        }
        Relationships: []
      }
      help_requests: {
        Row: {
          category: string
          created_at: string | null
          description: string | null
          helper_id: string | null
          helper_username: string | null
          id: string
          requester_id: string
          requester_username: string
          resolved_at: string | null
          status: string | null
          title: string
          updated_at: string | null
        }
        Insert: {
          category: string
          created_at?: string | null
          description?: string | null
          helper_id?: string | null
          helper_username?: string | null
          id?: string
          requester_id: string
          requester_username: string
          resolved_at?: string | null
          status?: string | null
          title: string
          updated_at?: string | null
        }
        Update: {
          category?: string
          created_at?: string | null
          description?: string | null
          helper_id?: string | null
          helper_username?: string | null
          id?: string
          requester_id?: string
          requester_username?: string
          resolved_at?: string | null
          status?: string | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "help_requests_helper_id_fkey"
            columns: ["helper_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "help_requests_requester_id_fkey"
            columns: ["requester_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      inspirations: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          id: string
          image_url: string | null
          latitude: number | null
          location_name: string | null
          longitude: number | null
          title: string
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          id?: string
          image_url?: string | null
          latitude?: number | null
          location_name?: string | null
          longitude?: number | null
          title: string
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          id?: string
          image_url?: string | null
          latitude?: number | null
          location_name?: string | null
          longitude?: number | null
          title?: string
        }
        Relationships: []
      }
      interested_prospects: {
        Row: {
          area_of_interest: string | null
          email: string
          full_name: string
          id: string
          linkedin_url: string | null
          submitted_at: string
        }
        Insert: {
          area_of_interest?: string | null
          email: string
          full_name: string
          id?: string
          linkedin_url?: string | null
          submitted_at?: string
        }
        Update: {
          area_of_interest?: string | null
          email?: string
          full_name?: string
          id?: string
          linkedin_url?: string | null
          submitted_at?: string
        }
        Relationships: []
      }
      inventory: {
        Row: {
          created_at: string | null
          id: number
          item_id: string
          source_platform: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          id?: number
          item_id: string
          source_platform?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          id?: number
          item_id?: string
          source_platform?: string | null
          user_id?: string
        }
        Relationships: []
      }
      invitations: {
        Row: {
          created_at: string | null
          email: string
          expires_at: string
          id: string
          role: string
          site_id: string
          status: string
          token: string
        }
        Insert: {
          created_at?: string | null
          email: string
          expires_at: string
          id?: string
          role: string
          site_id: string
          status?: string
          token: string
        }
        Update: {
          created_at?: string | null
          email?: string
          expires_at?: string
          id?: string
          role?: string
          site_id?: string
          status?: string
          token?: string
        }
        Relationships: [
          {
            foreignKeyName: "invitations_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "invitations_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      invites: {
        Row: {
          accepted_at: string | null
          accepted_by: string | null
          created_at: string
          id: string
          invitee_email: string
          inviter_id: string
          message: string | null
          status: string
          token: string
        }
        Insert: {
          accepted_at?: string | null
          accepted_by?: string | null
          created_at?: string
          id?: string
          invitee_email: string
          inviter_id: string
          message?: string | null
          status?: string
          token: string
        }
        Update: {
          accepted_at?: string | null
          accepted_by?: string | null
          created_at?: string
          id?: string
          invitee_email?: string
          inviter_id?: string
          message?: string | null
          status?: string
          token?: string
        }
        Relationships: []
      }
      invoices: {
        Row: {
          amount: number
          created_at: string | null
          due_date: string | null
          id: string
          recipient_id: string | null
          sender_id: string
          site_id: string
          status: string | null
          updated_at: string | null
        }
        Insert: {
          amount: number
          created_at?: string | null
          due_date?: string | null
          id?: string
          recipient_id?: string | null
          sender_id: string
          site_id: string
          status?: string | null
          updated_at?: string | null
        }
        Update: {
          amount?: number
          created_at?: string | null
          due_date?: string | null
          id?: string
          recipient_id?: string | null
          sender_id?: string
          site_id?: string
          status?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "invoices_recipient_id_fkey"
            columns: ["recipient_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "invoices_sender_id_fkey"
            columns: ["sender_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "invoices_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "invoices_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      ip_blacklist: {
        Row: {
          added_by: string | null
          created_at: string
          expires_at: string | null
          id: string
          ip_address: string
          reason: string | null
        }
        Insert: {
          added_by?: string | null
          created_at?: string
          expires_at?: string | null
          id?: string
          ip_address: string
          reason?: string | null
        }
        Update: {
          added_by?: string | null
          created_at?: string
          expires_at?: string | null
          id?: string
          ip_address?: string
          reason?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "ip_blacklist_added_by_fkey"
            columns: ["added_by"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      job_applications: {
        Row: {
          cover_letter: string | null
          id: string
          job_id: string
          resume_url: string
          status: string
          submitted_at: string
          user_id: string
        }
        Insert: {
          cover_letter?: string | null
          id?: string
          job_id: string
          resume_url: string
          status?: string
          submitted_at?: string
          user_id: string
        }
        Update: {
          cover_letter?: string | null
          id?: string
          job_id?: string
          resume_url?: string
          status?: string
          submitted_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "job_applications_job_id_fkey"
            columns: ["job_id"]
            isOneToOne: false
            referencedRelation: "job_openings"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "job_applications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      job_openings: {
        Row: {
          department: string | null
          description: string | null
          id: string
          is_internal: boolean | null
          location: string | null
          posted_at: string | null
          site_id: string
          status: string | null
          title: string
        }
        Insert: {
          department?: string | null
          description?: string | null
          id?: string
          is_internal?: boolean | null
          location?: string | null
          posted_at?: string | null
          site_id: string
          status?: string | null
          title: string
        }
        Update: {
          department?: string | null
          description?: string | null
          id?: string
          is_internal?: boolean | null
          location?: string | null
          posted_at?: string | null
          site_id?: string
          status?: string | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "job_openings_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "job_openings_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      knowledge: {
        Row: {
          created_at: number
          data: Json | null
          description: string | null
          id: string
          meta: Json | null
          name: string
          updated_at: number | null
          user_id: string
        }
        Insert: {
          created_at: number
          data?: Json | null
          description?: string | null
          id: string
          meta?: Json | null
          name: string
          updated_at?: number | null
          user_id: string
        }
        Update: {
          created_at?: number
          data?: Json | null
          description?: string | null
          id?: string
          meta?: Json | null
          name?: string
          updated_at?: number | null
          user_id?: string
        }
        Relationships: []
      }
      knowledge_base: {
        Row: {
          answer: string
          category: string | null
          created_at: string | null
          id: string
          question: string
          site_id: string
          tags: string[] | null
        }
        Insert: {
          answer: string
          category?: string | null
          created_at?: string | null
          id?: string
          question: string
          site_id: string
          tags?: string[] | null
        }
        Update: {
          answer?: string
          category?: string | null
          created_at?: string | null
          id?: string
          question?: string
          site_id?: string
          tags?: string[] | null
        }
        Relationships: [
          {
            foreignKeyName: "knowledge_base_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "knowledge_base_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      knowledge_file: {
        Row: {
          created_at: number
          file_id: string
          id: string
          knowledge_id: string
          updated_at: number
          user_id: string
        }
        Insert: {
          created_at: number
          file_id: string
          id: string
          knowledge_id: string
          updated_at: number
          user_id: string
        }
        Update: {
          created_at?: number
          file_id?: string
          id?: string
          knowledge_id?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "knowledge_file_file_id_fkey"
            columns: ["file_id"]
            isOneToOne: false
            referencedRelation: "file"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "knowledge_file_knowledge_id_fkey"
            columns: ["knowledge_id"]
            isOneToOne: false
            referencedRelation: "knowledge"
            referencedColumns: ["id"]
          },
        ]
      }
      lab_experiment_feedback: {
        Row: {
          content: string
          created_at: string
          email: string | null
          experiment: string
          feedback_type: string
          id: string
          priority: number | null
          status: string
          title: string | null
          updated_at: string
          user_id: string | null
          votes: number | null
        }
        Insert: {
          content: string
          created_at?: string
          email?: string | null
          experiment: string
          feedback_type: string
          id?: string
          priority?: number | null
          status?: string
          title?: string | null
          updated_at?: string
          user_id?: string | null
          votes?: number | null
        }
        Update: {
          content?: string
          created_at?: string
          email?: string | null
          experiment?: string
          feedback_type?: string
          id?: string
          priority?: number | null
          status?: string
          title?: string | null
          updated_at?: string
          user_id?: string | null
          votes?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "lab_experiment_feedback_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      lab_experiment_votes: {
        Row: {
          created_at: string
          feedback_id: string
          id: string
          voter_email: string
        }
        Insert: {
          created_at?: string
          feedback_id: string
          id?: string
          voter_email: string
        }
        Update: {
          created_at?: string
          feedback_id?: string
          id?: string
          voter_email?: string
        }
        Relationships: [
          {
            foreignKeyName: "lab_experiment_votes_feedback_id_fkey"
            columns: ["feedback_id"]
            isOneToOne: false
            referencedRelation: "lab_experiment_feedback"
            referencedColumns: ["id"]
          },
        ]
      }
      lab_experiment_waitlist: {
        Row: {
          company: string | null
          created_at: string
          email: string
          experiment: string
          id: string
          invited_at: string | null
          name: string | null
          role: string | null
          source: string | null
          status: string
          updated_at: string
          use_case: string | null
        }
        Insert: {
          company?: string | null
          created_at?: string
          email: string
          experiment: string
          id?: string
          invited_at?: string | null
          name?: string | null
          role?: string | null
          source?: string | null
          status?: string
          updated_at?: string
          use_case?: string | null
        }
        Update: {
          company?: string | null
          created_at?: string
          email?: string
          experiment?: string
          id?: string
          invited_at?: string | null
          name?: string | null
          role?: string | null
          source?: string | null
          status?: string
          updated_at?: string
          use_case?: string | null
        }
        Relationships: []
      }
      lab_newsletter_subscribers: {
        Row: {
          created_at: string
          email: string
          id: string
          name: string | null
          status: string
          subscribed_topics: string[] | null
          unsubscribed_at: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          name?: string | null
          status?: string
          subscribed_topics?: string[] | null
          unsubscribed_at?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          name?: string | null
          status?: string
          subscribed_topics?: string[] | null
          unsubscribed_at?: string | null
          updated_at?: string
        }
        Relationships: []
      }
      labs_playbooks: {
        Row: {
          content_md: string
          created_at: string
          difficulty: string | null
          estimated_time_minutes: number | null
          experiment: string
          id: string
          is_published: boolean | null
          order_index: number | null
          prerequisites: string[] | null
          slug: string
          summary: string | null
          tags: string[] | null
          title: string
          updated_at: string
        }
        Insert: {
          content_md: string
          created_at?: string
          difficulty?: string | null
          estimated_time_minutes?: number | null
          experiment: string
          id?: string
          is_published?: boolean | null
          order_index?: number | null
          prerequisites?: string[] | null
          slug: string
          summary?: string | null
          tags?: string[] | null
          title: string
          updated_at?: string
        }
        Update: {
          content_md?: string
          created_at?: string
          difficulty?: string | null
          estimated_time_minutes?: number | null
          experiment?: string
          id?: string
          is_published?: boolean | null
          order_index?: number | null
          prerequisites?: string[] | null
          slug?: string
          summary?: string | null
          tags?: string[] | null
          title?: string
          updated_at?: string
        }
        Relationships: []
      }
      labs_tool_releases: {
        Row: {
          changelog_md: string | null
          checksum: string | null
          created_at: string
          download_count: number | null
          download_url: string | null
          file_size_bytes: number | null
          id: string
          is_latest: boolean | null
          platform: string | null
          published_at: string
          tool_id: string
          version: string
        }
        Insert: {
          changelog_md?: string | null
          checksum?: string | null
          created_at?: string
          download_count?: number | null
          download_url?: string | null
          file_size_bytes?: number | null
          id?: string
          is_latest?: boolean | null
          platform?: string | null
          published_at?: string
          tool_id: string
          version: string
        }
        Update: {
          changelog_md?: string | null
          checksum?: string | null
          created_at?: string
          download_count?: number | null
          download_url?: string | null
          file_size_bytes?: number | null
          id?: string
          is_latest?: boolean | null
          platform?: string | null
          published_at?: string
          tool_id?: string
          version?: string
        }
        Relationships: [
          {
            foreignKeyName: "labs_tool_releases_tool_id_fkey"
            columns: ["tool_id"]
            isOneToOne: false
            referencedRelation: "labs_tools"
            referencedColumns: ["id"]
          },
        ]
      }
      labs_tools: {
        Row: {
          category: string
          created_at: string
          description: string | null
          docs_url: string | null
          github_url: string | null
          hero_image_url: string | null
          id: string
          name: string
          slug: string
          status: string
          updated_at: string
        }
        Insert: {
          category?: string
          created_at?: string
          description?: string | null
          docs_url?: string | null
          github_url?: string | null
          hero_image_url?: string | null
          id?: string
          name: string
          slug: string
          status?: string
          updated_at?: string
        }
        Update: {
          category?: string
          created_at?: string
          description?: string | null
          docs_url?: string | null
          github_url?: string | null
          hero_image_url?: string | null
          id?: string
          name?: string
          slug?: string
          status?: string
          updated_at?: string
        }
        Relationships: []
      }
      launcher_profiles: {
        Row: {
          achievements_unlocked: number
          allow_friend_requests: boolean
          banner_url: string | null
          bio: string | null
          created_at: string | null
          custom_status: string | null
          discord_username: string | null
          display_name: string | null
          featured_badge: string | null
          games_owned: number
          github_username: string | null
          id: string
          level: number
          location: string | null
          profile_visibility: string
          pronouns: string | null
          show_activity_status: boolean
          show_game_activity: boolean
          show_online_status: boolean
          showcase_items: Json | null
          status: string
          theme_accent: string | null
          total_playtime: number
          twitch_username: string | null
          twitter_handle: string | null
          updated_at: string | null
          user_id: string
          website: string | null
          xp: number
          youtube_channel: string | null
        }
        Insert: {
          achievements_unlocked?: number
          allow_friend_requests?: boolean
          banner_url?: string | null
          bio?: string | null
          created_at?: string | null
          custom_status?: string | null
          discord_username?: string | null
          display_name?: string | null
          featured_badge?: string | null
          games_owned?: number
          github_username?: string | null
          id?: string
          level?: number
          location?: string | null
          profile_visibility?: string
          pronouns?: string | null
          show_activity_status?: boolean
          show_game_activity?: boolean
          show_online_status?: boolean
          showcase_items?: Json | null
          status?: string
          theme_accent?: string | null
          total_playtime?: number
          twitch_username?: string | null
          twitter_handle?: string | null
          updated_at?: string | null
          user_id: string
          website?: string | null
          xp?: number
          youtube_channel?: string | null
        }
        Update: {
          achievements_unlocked?: number
          allow_friend_requests?: boolean
          banner_url?: string | null
          bio?: string | null
          created_at?: string | null
          custom_status?: string | null
          discord_username?: string | null
          display_name?: string | null
          featured_badge?: string | null
          games_owned?: number
          github_username?: string | null
          id?: string
          level?: number
          location?: string | null
          profile_visibility?: string
          pronouns?: string | null
          show_activity_status?: boolean
          show_game_activity?: boolean
          show_online_status?: boolean
          showcase_items?: Json | null
          status?: string
          theme_accent?: string | null
          total_playtime?: number
          twitch_username?: string | null
          twitter_handle?: string | null
          updated_at?: string | null
          user_id?: string
          website?: string | null
          xp?: number
          youtube_channel?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "launcher_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      lesson_progress: {
        Row: {
          completed_at: string | null
          course_id: string | null
          id: string
          lesson_id: string | null
          started_at: string | null
          time_spent_seconds: number | null
          user_id: string | null
        }
        Insert: {
          completed_at?: string | null
          course_id?: string | null
          id?: string
          lesson_id?: string | null
          started_at?: string | null
          time_spent_seconds?: number | null
          user_id?: string | null
        }
        Update: {
          completed_at?: string | null
          course_id?: string | null
          id?: string
          lesson_id?: string | null
          started_at?: string | null
          time_spent_seconds?: number | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "lesson_progress_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "courses"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "lesson_progress_lesson_id_fkey"
            columns: ["lesson_id"]
            isOneToOne: false
            referencedRelation: "lessons"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "lesson_progress_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      lessons: {
        Row: {
          content: string | null
          content_type: string | null
          course_id: string | null
          created_at: string | null
          description: string | null
          duration_minutes: number | null
          id: string
          is_free: boolean | null
          is_published: boolean | null
          order_index: number | null
          slug: string
          title: string
          updated_at: string | null
          video_url: string | null
          xp_reward: number | null
        }
        Insert: {
          content?: string | null
          content_type?: string | null
          course_id?: string | null
          created_at?: string | null
          description?: string | null
          duration_minutes?: number | null
          id?: string
          is_free?: boolean | null
          is_published?: boolean | null
          order_index?: number | null
          slug: string
          title: string
          updated_at?: string | null
          video_url?: string | null
          xp_reward?: number | null
        }
        Update: {
          content?: string | null
          content_type?: string | null
          course_id?: string | null
          created_at?: string | null
          description?: string | null
          duration_minutes?: number | null
          id?: string
          is_free?: boolean | null
          is_published?: boolean | null
          order_index?: number | null
          slug?: string
          title?: string
          updated_at?: string | null
          video_url?: string | null
          xp_reward?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "lessons_course_id_fkey"
            columns: ["course_id"]
            isOneToOne: false
            referencedRelation: "courses"
            referencedColumns: ["id"]
          },
        ]
      }
      level_roles: {
        Row: {
          created_at: string
          icon: string | null
          id: string
          level_threshold: number
          role_name: string
        }
        Insert: {
          created_at?: string
          icon?: string | null
          id?: string
          level_threshold: number
          role_name: string
        }
        Update: {
          created_at?: string
          icon?: string | null
          id?: string
          level_threshold?: number
          role_name?: string
        }
        Relationships: []
      }
      listings: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          featured: boolean | null
          id: string
          images: string[] | null
          price: number
          seller_id: string
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          featured?: boolean | null
          id?: string
          images?: string[] | null
          price: number
          seller_id: string
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          featured?: boolean | null
          id?: string
          images?: string[] | null
          price?: number
          seller_id?: string
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "listings_seller_id_fkey"
            columns: ["seller_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      marketplace_listings: {
        Row: {
          asset_id: number | null
          auction_end_time: string | null
          chain_id: number | null
          contract_address: string | null
          created_at: string | null
          current_bid: number | null
          description: string | null
          download_url: string | null
          expires_at: string | null
          file_url: string | null
          highest_bidder_address: string | null
          id: number
          item_type: string
          license_type: string | null
          listing_type: string
          nonce: string | null
          preview_url: string | null
          price: number
          price_currency: string
          quantity: number | null
          reserve_price: number | null
          seller_address: string
          seller_id: string | null
          signature: string | null
          starting_price: number | null
          status: string | null
          title: string
          token_id: string | null
          updated_at: string | null
        }
        Insert: {
          asset_id?: number | null
          auction_end_time?: string | null
          chain_id?: number | null
          contract_address?: string | null
          created_at?: string | null
          current_bid?: number | null
          description?: string | null
          download_url?: string | null
          expires_at?: string | null
          file_url?: string | null
          highest_bidder_address?: string | null
          id?: number
          item_type: string
          license_type?: string | null
          listing_type: string
          nonce?: string | null
          preview_url?: string | null
          price: number
          price_currency?: string
          quantity?: number | null
          reserve_price?: number | null
          seller_address: string
          seller_id?: string | null
          signature?: string | null
          starting_price?: number | null
          status?: string | null
          title: string
          token_id?: string | null
          updated_at?: string | null
        }
        Update: {
          asset_id?: number | null
          auction_end_time?: string | null
          chain_id?: number | null
          contract_address?: string | null
          created_at?: string | null
          current_bid?: number | null
          description?: string | null
          download_url?: string | null
          expires_at?: string | null
          file_url?: string | null
          highest_bidder_address?: string | null
          id?: number
          item_type?: string
          license_type?: string | null
          listing_type?: string
          nonce?: string | null
          preview_url?: string | null
          price?: number
          price_currency?: string
          quantity?: number | null
          reserve_price?: number | null
          seller_address?: string
          seller_id?: string | null
          signature?: string | null
          starting_price?: number | null
          status?: string | null
          title?: string
          token_id?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "marketplace_listings_asset_id_fkey"
            columns: ["asset_id"]
            isOneToOne: false
            referencedRelation: "nft_assets"
            referencedColumns: ["id"]
          },
        ]
      }
      marketplace_offers: {
        Row: {
          asset_id: number | null
          collection_id: number | null
          created_at: string | null
          expires_at: string
          id: number
          listing_id: number | null
          nonce: string | null
          offerer_address: string
          offerer_id: string | null
          price: number
          price_currency: string
          quantity: number | null
          signature: string | null
          status: string | null
          updated_at: string | null
        }
        Insert: {
          asset_id?: number | null
          collection_id?: number | null
          created_at?: string | null
          expires_at: string
          id?: number
          listing_id?: number | null
          nonce?: string | null
          offerer_address: string
          offerer_id?: string | null
          price: number
          price_currency?: string
          quantity?: number | null
          signature?: string | null
          status?: string | null
          updated_at?: string | null
        }
        Update: {
          asset_id?: number | null
          collection_id?: number | null
          created_at?: string | null
          expires_at?: string
          id?: number
          listing_id?: number | null
          nonce?: string | null
          offerer_address?: string
          offerer_id?: string | null
          price?: number
          price_currency?: string
          quantity?: number | null
          signature?: string | null
          status?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "marketplace_offers_asset_id_fkey"
            columns: ["asset_id"]
            isOneToOne: false
            referencedRelation: "nft_assets"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "marketplace_offers_collection_id_fkey"
            columns: ["collection_id"]
            isOneToOne: false
            referencedRelation: "nft_collections"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "marketplace_offers_listing_id_fkey"
            columns: ["listing_id"]
            isOneToOne: false
            referencedRelation: "marketplace_listings"
            referencedColumns: ["id"]
          },
        ]
      }
      member_activities: {
        Row: {
          activity_type: string
          created_at: string | null
          id: string
          metadata: Json | null
          user_id: string
        }
        Insert: {
          activity_type: string
          created_at?: string | null
          id?: string
          metadata?: Json | null
          user_id: string
        }
        Update: {
          activity_type?: string
          created_at?: string | null
          id?: string
          metadata?: Json | null
          user_id?: string
        }
        Relationships: []
      }
      memory: {
        Row: {
          content: string
          created_at: number
          id: string
          updated_at: number
          user_id: string
        }
        Insert: {
          content: string
          created_at: number
          id: string
          updated_at: number
          user_id: string
        }
        Update: {
          content?: string
          created_at?: number
          id?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: []
      }
      mentors: {
        Row: {
          available: boolean
          bio: string | null
          created_at: string
          expertise: string[]
          hourly_rate: number | null
          updated_at: string
          user_id: string
        }
        Insert: {
          available?: boolean
          bio?: string | null
          created_at?: string
          expertise?: string[]
          hourly_rate?: number | null
          updated_at?: string
          user_id: string
        }
        Update: {
          available?: boolean
          bio?: string | null
          created_at?: string
          expertise?: string[]
          hourly_rate?: number | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "mentors_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      mentorship_requests: {
        Row: {
          created_at: string
          id: string
          mentee_id: string
          mentor_id: string
          message: string | null
          status: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          id?: string
          mentee_id: string
          mentor_id: string
          message?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          id?: string
          mentee_id?: string
          mentor_id?: string
          message?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "mentorship_requests_mentee_id_fkey"
            columns: ["mentee_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "mentorship_requests_mentor_id_fkey"
            columns: ["mentor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      message: {
        Row: {
          channel_id: string | null
          content: string | null
          created_at: number | null
          data: Json | null
          id: string
          is_pinned: boolean
          meta: Json | null
          parent_id: string | null
          pinned_at: number | null
          pinned_by: string | null
          reply_to_id: string | null
          updated_at: number | null
          user_id: string | null
        }
        Insert: {
          channel_id?: string | null
          content?: string | null
          created_at?: number | null
          data?: Json | null
          id: string
          is_pinned?: boolean
          meta?: Json | null
          parent_id?: string | null
          pinned_at?: number | null
          pinned_by?: string | null
          reply_to_id?: string | null
          updated_at?: number | null
          user_id?: string | null
        }
        Update: {
          channel_id?: string | null
          content?: string | null
          created_at?: number | null
          data?: Json | null
          id?: string
          is_pinned?: boolean
          meta?: Json | null
          parent_id?: string | null
          pinned_at?: number | null
          pinned_by?: string | null
          reply_to_id?: string | null
          updated_at?: number | null
          user_id?: string | null
        }
        Relationships: []
      }
      message_reaction: {
        Row: {
          created_at: number | null
          id: string
          message_id: string
          name: string
          user_id: string
        }
        Insert: {
          created_at?: number | null
          id: string
          message_id: string
          name: string
          user_id: string
        }
        Update: {
          created_at?: number | null
          id?: string
          message_id?: string
          name?: string
          user_id?: string
        }
        Relationships: []
      }
      message_reactions: {
        Row: {
          created_at: string | null
          emoji: string
          id: string
          message_id: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          emoji: string
          id?: string
          message_id: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          emoji?: string
          id?: string
          message_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "message_reactions_message_id_fkey"
            columns: ["message_id"]
            isOneToOne: false
            referencedRelation: "messages"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "message_reactions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      messages: {
        Row: {
          channel_id: string | null
          content: string
          conversation_id: string
          created_at: string
          id: string
          is_read: boolean
          reply_to_id: string | null
          sender_id: string
          subject: string | null
          type: string
        }
        Insert: {
          channel_id?: string | null
          content: string
          conversation_id: string
          created_at?: string
          id?: string
          is_read?: boolean
          reply_to_id?: string | null
          sender_id: string
          subject?: string | null
          type?: string
        }
        Update: {
          channel_id?: string | null
          content?: string
          conversation_id?: string
          created_at?: string
          id?: string
          is_read?: boolean
          reply_to_id?: string | null
          sender_id?: string
          subject?: string | null
          type?: string
        }
        Relationships: [
          {
            foreignKeyName: "messages_conversation_id_fkey"
            columns: ["conversation_id"]
            isOneToOne: false
            referencedRelation: "conversations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "messages_sender_id_fkey"
            columns: ["sender_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      metrics: {
        Row: {
          active_nodes: number | null
          id: number
          last_sync: string | null
          node_name: string
          recorded_at: string | null
          uptime: number | null
        }
        Insert: {
          active_nodes?: number | null
          id?: number
          last_sync?: string | null
          node_name: string
          recorded_at?: string | null
          uptime?: number | null
        }
        Update: {
          active_nodes?: number | null
          id?: number
          last_sync?: string | null
          node_name?: string
          recorded_at?: string | null
          uptime?: number | null
        }
        Relationships: []
      }
      migratehistory: {
        Row: {
          id: number
          migrated_at: string
          name: string
        }
        Insert: {
          id?: number
          migrated_at: string
          name: string
        }
        Update: {
          id?: number
          migrated_at?: string
          name?: string
        }
        Relationships: []
      }
      mod_actions: {
        Row: {
          action: string
          created_at: string | null
          duration_minutes: number | null
          guild_id: string
          id: number
          moderator_id: string
          moderator_tag: string | null
          reason: string | null
          user_id: string
          user_tag: string | null
        }
        Insert: {
          action: string
          created_at?: string | null
          duration_minutes?: number | null
          guild_id: string
          id?: number
          moderator_id: string
          moderator_tag?: string | null
          reason?: string | null
          user_id: string
          user_tag?: string | null
        }
        Update: {
          action?: string
          created_at?: string | null
          duration_minutes?: number | null
          guild_id?: string
          id?: number
          moderator_id?: string
          moderator_tag?: string | null
          reason?: string | null
          user_id?: string
          user_tag?: string | null
        }
        Relationships: []
      }
      model: {
        Row: {
          base_model_id: string | null
          created_at: number
          id: string
          is_active: boolean
          meta: string
          name: string
          params: string
          updated_at: number
          user_id: string
        }
        Insert: {
          base_model_id?: string | null
          created_at: number
          id: string
          is_active?: boolean
          meta: string
          name: string
          params: string
          updated_at: number
          user_id: string
        }
        Update: {
          base_model_id?: string | null
          created_at?: number
          id?: string
          is_active?: boolean
          meta?: string
          name?: string
          params?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: []
      }
      moderation_reports: {
        Row: {
          created_at: string
          details: string | null
          id: string
          reason: string
          reporter_id: string | null
          status: string
          target_id: string | null
          target_type: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          details?: string | null
          id?: string
          reason: string
          reporter_id?: string | null
          status?: string
          target_id?: string | null
          target_type: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          details?: string | null
          id?: string
          reason?: string
          reporter_id?: string | null
          status?: string
          target_id?: string | null
          target_type?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "moderation_reports_reporter_id_fkey"
            columns: ["reporter_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      mrpiglr_events: {
        Row: {
          created_at: string
          description: string | null
          end_time: string | null
          event_type: string | null
          id: string
          image_url: string | null
          site_id: string | null
          start_time: string
          stream_url: string | null
          title: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          end_time?: string | null
          event_type?: string | null
          id?: string
          image_url?: string | null
          site_id?: string | null
          start_time: string
          stream_url?: string | null
          title: string
        }
        Update: {
          created_at?: string
          description?: string | null
          end_time?: string | null
          event_type?: string | null
          id?: string
          image_url?: string | null
          site_id?: string | null
          start_time?: string
          stream_url?: string | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "mrpiglr_events_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "mrpiglr_events_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      mrpiglr_site_badges: {
        Row: {
          category: string | null
          color: string | null
          created_at: string
          description: string | null
          icon: string | null
          id: string
          name: string
          required_value: number | null
          tier: number | null
        }
        Insert: {
          category?: string | null
          color?: string | null
          created_at?: string
          description?: string | null
          icon?: string | null
          id?: string
          name: string
          required_value?: number | null
          tier?: number | null
        }
        Update: {
          category?: string | null
          color?: string | null
          created_at?: string
          description?: string | null
          icon?: string | null
          id?: string
          name?: string
          required_value?: number | null
          tier?: number | null
        }
        Relationships: []
      }
      mrpiglr_waitlist: {
        Row: {
          created_at: string
          email: string
          id: string
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
        }
        Relationships: []
      }
      music: {
        Row: {
          album: string | null
          artist: string
          created_at: string
          description: string | null
          display_order: number | null
          duration: string | null
          genre: string | null
          id: string
          image_prompt: string | null
          image_url: string | null
          links: Json | null
          site_id: string
          title: string
          year: string | null
          youtube_id: string | null
        }
        Insert: {
          album?: string | null
          artist: string
          created_at?: string
          description?: string | null
          display_order?: number | null
          duration?: string | null
          genre?: string | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          links?: Json | null
          site_id: string
          title: string
          year?: string | null
          youtube_id?: string | null
        }
        Update: {
          album?: string | null
          artist?: string
          created_at?: string
          description?: string | null
          display_order?: number | null
          duration?: string | null
          genre?: string | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          links?: Json | null
          site_id?: string
          title?: string
          year?: string | null
          youtube_id?: string | null
        }
        Relationships: []
      }
      newsletter_subscribers: {
        Row: {
          created_at: string
          email: string
          id: string
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
        }
        Relationships: []
      }
      nexus_applications: {
        Row: {
          application_questions: Json | null
          cover_letter: string | null
          created_at: string
          creator_id: string
          id: string
          opportunity_id: string
          proposal: string | null
          proposed_rate: number | null
          responded_at: string | null
          response_message: string | null
          status: string
          updated_at: string
          viewed_at: string | null
        }
        Insert: {
          application_questions?: Json | null
          cover_letter?: string | null
          created_at?: string
          creator_id: string
          id?: string
          opportunity_id: string
          proposal?: string | null
          proposed_rate?: number | null
          responded_at?: string | null
          response_message?: string | null
          status?: string
          updated_at?: string
          viewed_at?: string | null
        }
        Update: {
          application_questions?: Json | null
          cover_letter?: string | null
          created_at?: string
          creator_id?: string
          id?: string
          opportunity_id?: string
          proposal?: string | null
          proposed_rate?: number | null
          responded_at?: string | null
          response_message?: string | null
          status?: string
          updated_at?: string
          viewed_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "nexus_applications_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_applications_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "foundation_gig_radar"
            referencedColumns: ["opportunity_id"]
          },
          {
            foreignKeyName: "nexus_applications_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "nexus_opportunities"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_commission_ledger: {
        Row: {
          aethex_revenue: number
          created_at: string
          creator_payouts: number
          id: string
          payment_id: string | null
          period_end: string | null
          period_start: string | null
          status: string
          total_commission: number
          total_volume: number
          updated_at: string
        }
        Insert: {
          aethex_revenue: number
          created_at?: string
          creator_payouts: number
          id?: string
          payment_id?: string | null
          period_end?: string | null
          period_start?: string | null
          status?: string
          total_commission: number
          total_volume: number
          updated_at?: string
        }
        Update: {
          aethex_revenue?: number
          created_at?: string
          creator_payouts?: number
          id?: string
          payment_id?: string | null
          period_end?: string | null
          period_start?: string | null
          status?: string
          total_commission?: number
          total_volume?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_commission_ledger_payment_id_fkey"
            columns: ["payment_id"]
            isOneToOne: false
            referencedRelation: "nexus_payments"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_compliance_events: {
        Row: {
          actor_id: string | null
          actor_role: string | null
          created_at: string
          cross_entity_access: boolean
          description: string | null
          entity_id: string
          entity_type: string
          event_category: string
          event_type: string
          financial_amount: number | null
          id: string
          ip_address: string | null
          legal_entity: string | null
          payload: Json | null
          realm_context: string | null
          sensitive_data_accessed: boolean
          user_agent: string | null
        }
        Insert: {
          actor_id?: string | null
          actor_role?: string | null
          created_at?: string
          cross_entity_access?: boolean
          description?: string | null
          entity_id: string
          entity_type: string
          event_category: string
          event_type: string
          financial_amount?: number | null
          id?: string
          ip_address?: string | null
          legal_entity?: string | null
          payload?: Json | null
          realm_context?: string | null
          sensitive_data_accessed?: boolean
          user_agent?: string | null
        }
        Update: {
          actor_id?: string | null
          actor_role?: string | null
          created_at?: string
          cross_entity_access?: boolean
          description?: string | null
          entity_id?: string
          entity_type?: string
          event_category?: string
          event_type?: string
          financial_amount?: number | null
          id?: string
          ip_address?: string | null
          legal_entity?: string | null
          payload?: Json | null
          realm_context?: string | null
          sensitive_data_accessed?: boolean
          user_agent?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "nexus_compliance_events_actor_id_fkey"
            columns: ["actor_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_contracts: {
        Row: {
          aethex_commission_amount: number
          aethex_commission_percent: number
          client_id: string
          contract_type: string
          created_at: string
          creator_id: string
          creator_payout_amount: number
          description: string | null
          end_date: string | null
          id: string
          milestone_count: number | null
          opportunity_id: string | null
          start_date: string | null
          status: string
          stripe_payment_intent_id: string | null
          title: string
          total_amount: number
          updated_at: string
        }
        Insert: {
          aethex_commission_amount?: number
          aethex_commission_percent?: number
          client_id: string
          contract_type: string
          created_at?: string
          creator_id: string
          creator_payout_amount?: number
          description?: string | null
          end_date?: string | null
          id?: string
          milestone_count?: number | null
          opportunity_id?: string | null
          start_date?: string | null
          status?: string
          stripe_payment_intent_id?: string | null
          title: string
          total_amount: number
          updated_at?: string
        }
        Update: {
          aethex_commission_amount?: number
          aethex_commission_percent?: number
          client_id?: string
          contract_type?: string
          created_at?: string
          creator_id?: string
          creator_payout_amount?: number
          description?: string | null
          end_date?: string | null
          id?: string
          milestone_count?: number | null
          opportunity_id?: string | null
          start_date?: string | null
          status?: string
          stripe_payment_intent_id?: string | null
          title?: string
          total_amount?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_contracts_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_contracts_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_contracts_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "foundation_gig_radar"
            referencedColumns: ["opportunity_id"]
          },
          {
            foreignKeyName: "nexus_contracts_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "nexus_opportunities"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_conversations: {
        Row: {
          contract_id: string | null
          created_at: string
          id: string
          last_message_at: string | null
          opportunity_id: string | null
          participant_1: string
          participant_2: string
          subject: string | null
          updated_at: string
        }
        Insert: {
          contract_id?: string | null
          created_at?: string
          id?: string
          last_message_at?: string | null
          opportunity_id?: string | null
          participant_1: string
          participant_2: string
          subject?: string | null
          updated_at?: string
        }
        Update: {
          contract_id?: string | null
          created_at?: string
          id?: string
          last_message_at?: string | null
          opportunity_id?: string | null
          participant_1?: string
          participant_2?: string
          subject?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_conversations_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_conversations_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "foundation_gig_radar"
            referencedColumns: ["opportunity_id"]
          },
          {
            foreignKeyName: "nexus_conversations_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "nexus_opportunities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_conversations_participant_1_fkey"
            columns: ["participant_1"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_conversations_participant_2_fkey"
            columns: ["participant_2"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_creator_profiles: {
        Row: {
          availability_hours_per_week: number | null
          availability_status: string
          bio: string | null
          created_at: string
          experience_level: string
          headline: string | null
          hourly_rate: number | null
          portfolio_url: string | null
          profile_image_url: string | null
          rating: number | null
          review_count: number
          skills: string[]
          stripe_account_verified: boolean | null
          stripe_connect_account_id: string | null
          total_earnings: number
          updated_at: string
          user_id: string
          verified: boolean
        }
        Insert: {
          availability_hours_per_week?: number | null
          availability_status?: string
          bio?: string | null
          created_at?: string
          experience_level?: string
          headline?: string | null
          hourly_rate?: number | null
          portfolio_url?: string | null
          profile_image_url?: string | null
          rating?: number | null
          review_count?: number
          skills?: string[]
          stripe_account_verified?: boolean | null
          stripe_connect_account_id?: string | null
          total_earnings?: number
          updated_at?: string
          user_id: string
          verified?: boolean
        }
        Update: {
          availability_hours_per_week?: number | null
          availability_status?: string
          bio?: string | null
          created_at?: string
          experience_level?: string
          headline?: string | null
          hourly_rate?: number | null
          portfolio_url?: string | null
          profile_image_url?: string | null
          rating?: number | null
          review_count?: number
          skills?: string[]
          stripe_account_verified?: boolean | null
          stripe_connect_account_id?: string | null
          total_earnings?: number
          updated_at?: string
          user_id?: string
          verified?: boolean
        }
        Relationships: [
          {
            foreignKeyName: "nexus_creator_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_disputes: {
        Row: {
          contract_id: string
          created_at: string
          description: string | null
          evidence_urls: string[] | null
          id: string
          reason: string
          reported_by: string
          resolution_notes: string | null
          resolved_at: string | null
          resolved_by: string | null
          status: string
          updated_at: string
        }
        Insert: {
          contract_id: string
          created_at?: string
          description?: string | null
          evidence_urls?: string[] | null
          id?: string
          reason: string
          reported_by: string
          resolution_notes?: string | null
          resolved_at?: string | null
          resolved_by?: string | null
          status?: string
          updated_at?: string
        }
        Update: {
          contract_id?: string
          created_at?: string
          description?: string | null
          evidence_urls?: string[] | null
          id?: string
          reason?: string
          reported_by?: string
          resolution_notes?: string | null
          resolved_at?: string | null
          resolved_by?: string | null
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_disputes_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_disputes_reported_by_fkey"
            columns: ["reported_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_disputes_resolved_by_fkey"
            columns: ["resolved_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_escrow_ledger: {
        Row: {
          aethex_fees: number
          client_id: string
          contract_id: string
          created_at: string
          creator_id: string
          escrow_balance: number
          funded_at: string | null
          funds_deposited: number
          funds_refunded: number
          funds_released: number
          id: string
          released_at: string | null
          status: string
          stripe_customer_id: string | null
          stripe_escrow_intent_id: string | null
          updated_at: string
        }
        Insert: {
          aethex_fees?: number
          client_id: string
          contract_id: string
          created_at?: string
          creator_id: string
          escrow_balance?: number
          funded_at?: string | null
          funds_deposited?: number
          funds_refunded?: number
          funds_released?: number
          id?: string
          released_at?: string | null
          status?: string
          stripe_customer_id?: string | null
          stripe_escrow_intent_id?: string | null
          updated_at?: string
        }
        Update: {
          aethex_fees?: number
          client_id?: string
          contract_id?: string
          created_at?: string
          creator_id?: string
          escrow_balance?: number
          funded_at?: string | null
          funds_deposited?: number
          funds_refunded?: number
          funds_released?: number
          id?: string
          released_at?: string | null
          status?: string
          stripe_customer_id?: string | null
          stripe_escrow_intent_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_escrow_ledger_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_escrow_ledger_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_escrow_ledger_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_integrations: {
        Row: {
          auto_mute_enabled: boolean | null
          current_game_session_id: string | null
          game_state: Json | null
          id: string
          overlay_enabled: boolean | null
          overlay_position: string | null
        }
        Insert: {
          auto_mute_enabled?: boolean | null
          current_game_session_id?: string | null
          game_state?: Json | null
          id?: string
          overlay_enabled?: boolean | null
          overlay_position?: string | null
        }
        Update: {
          auto_mute_enabled?: boolean | null
          current_game_session_id?: string | null
          game_state?: Json | null
          id?: string
          overlay_enabled?: boolean | null
          overlay_position?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "fk_current_game_session"
            columns: ["current_game_session_id"]
            isOneToOne: false
            referencedRelation: "game_sessions"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_messages: {
        Row: {
          contract_id: string | null
          conversation_id: string | null
          created_at: string
          id: string
          is_read: boolean
          message_text: string
          opportunity_id: string | null
          read_at: string | null
          recipient_id: string
          sender_id: string
        }
        Insert: {
          contract_id?: string | null
          conversation_id?: string | null
          created_at?: string
          id?: string
          is_read?: boolean
          message_text: string
          opportunity_id?: string | null
          read_at?: string | null
          recipient_id: string
          sender_id: string
        }
        Update: {
          contract_id?: string | null
          conversation_id?: string | null
          created_at?: string
          id?: string
          is_read?: boolean
          message_text?: string
          opportunity_id?: string | null
          read_at?: string | null
          recipient_id?: string
          sender_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_messages_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_messages_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "foundation_gig_radar"
            referencedColumns: ["opportunity_id"]
          },
          {
            foreignKeyName: "nexus_messages_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "nexus_opportunities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_messages_recipient_id_fkey"
            columns: ["recipient_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_messages_sender_id_fkey"
            columns: ["sender_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_milestones: {
        Row: {
          amount: number
          contract_id: string
          created_at: string
          description: string | null
          due_date: string | null
          id: string
          milestone_number: number
          status: string
          updated_at: string
        }
        Insert: {
          amount: number
          contract_id: string
          created_at?: string
          description?: string | null
          due_date?: string | null
          id?: string
          milestone_number: number
          status?: string
          updated_at?: string
        }
        Update: {
          amount?: number
          contract_id?: string
          created_at?: string
          description?: string | null
          due_date?: string | null
          id?: string
          milestone_number?: number
          status?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_milestones_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_opportunities: {
        Row: {
          application_count: number
          budget_max: number | null
          budget_min: number | null
          budget_type: string
          category: string
          closed_at: string | null
          company_name: string | null
          created_at: string
          description: string
          duration_weeks: number | null
          id: string
          is_featured: boolean
          location_requirement: string | null
          posted_by: string
          published_at: string
          required_experience: string | null
          required_skills: string[]
          selected_creator_id: string | null
          status: string
          timeline_type: string
          title: string
          updated_at: string
          views: number
        }
        Insert: {
          application_count?: number
          budget_max?: number | null
          budget_min?: number | null
          budget_type: string
          category: string
          closed_at?: string | null
          company_name?: string | null
          created_at?: string
          description: string
          duration_weeks?: number | null
          id?: string
          is_featured?: boolean
          location_requirement?: string | null
          posted_by: string
          published_at?: string
          required_experience?: string | null
          required_skills?: string[]
          selected_creator_id?: string | null
          status?: string
          timeline_type?: string
          title: string
          updated_at?: string
          views?: number
        }
        Update: {
          application_count?: number
          budget_max?: number | null
          budget_min?: number | null
          budget_type?: string
          category?: string
          closed_at?: string | null
          company_name?: string | null
          created_at?: string
          description?: string
          duration_weeks?: number | null
          id?: string
          is_featured?: boolean
          location_requirement?: string | null
          posted_by?: string
          published_at?: string
          required_experience?: string | null
          required_skills?: string[]
          selected_creator_id?: string | null
          status?: string
          timeline_type?: string
          title?: string
          updated_at?: string
          views?: number
        }
        Relationships: [
          {
            foreignKeyName: "nexus_opportunities_posted_by_fkey"
            columns: ["posted_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_opportunities_selected_creator_id_fkey"
            columns: ["selected_creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_payments: {
        Row: {
          aethex_commission: number
          amount: number
          contract_id: string
          created_at: string
          creator_payout: number
          id: string
          milestone_id: string | null
          payment_date: string | null
          payment_method: string
          payment_status: string
          payout_date: string | null
          stripe_charge_id: string | null
          stripe_payment_intent_id: string | null
          updated_at: string
        }
        Insert: {
          aethex_commission: number
          amount: number
          contract_id: string
          created_at?: string
          creator_payout: number
          id?: string
          milestone_id?: string | null
          payment_date?: string | null
          payment_method?: string
          payment_status?: string
          payout_date?: string | null
          stripe_charge_id?: string | null
          stripe_payment_intent_id?: string | null
          updated_at?: string
        }
        Update: {
          aethex_commission?: number
          amount?: number
          contract_id?: string
          created_at?: string
          creator_payout?: number
          id?: string
          milestone_id?: string | null
          payment_date?: string | null
          payment_method?: string
          payment_status?: string
          payout_date?: string | null
          stripe_charge_id?: string | null
          stripe_payment_intent_id?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_payments_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_payments_milestone_id_fkey"
            columns: ["milestone_id"]
            isOneToOne: false
            referencedRelation: "nexus_milestones"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_payouts: {
        Row: {
          ach_trace_number: string | null
          check_number: string | null
          contract_id: string | null
          created_at: string
          failure_reason: string | null
          gross_amount: number
          id: string
          net_amount: number
          payment_id: string | null
          payout_method: string
          platform_fee: number
          processed_at: string | null
          processing_fee: number
          scheduled_date: string | null
          status: string
          stripe_payout_id: string | null
          talent_profile_id: string
          tax_form_file_id: string | null
          tax_form_generated: boolean
          tax_form_type: string | null
          tax_withholding: number
          tax_year: number
          updated_at: string
        }
        Insert: {
          ach_trace_number?: string | null
          check_number?: string | null
          contract_id?: string | null
          created_at?: string
          failure_reason?: string | null
          gross_amount: number
          id?: string
          net_amount: number
          payment_id?: string | null
          payout_method?: string
          platform_fee?: number
          processed_at?: string | null
          processing_fee?: number
          scheduled_date?: string | null
          status?: string
          stripe_payout_id?: string | null
          talent_profile_id: string
          tax_form_file_id?: string | null
          tax_form_generated?: boolean
          tax_form_type?: string | null
          tax_withholding?: number
          tax_year?: number
          updated_at?: string
        }
        Update: {
          ach_trace_number?: string | null
          check_number?: string | null
          contract_id?: string | null
          created_at?: string
          failure_reason?: string | null
          gross_amount?: number
          id?: string
          net_amount?: number
          payment_id?: string | null
          payout_method?: string
          platform_fee?: number
          processed_at?: string | null
          processing_fee?: number
          scheduled_date?: string | null
          status?: string
          stripe_payout_id?: string | null
          talent_profile_id?: string
          tax_form_file_id?: string | null
          tax_form_generated?: boolean
          tax_form_type?: string | null
          tax_withholding?: number
          tax_year?: number
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_payouts_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_payouts_payment_id_fkey"
            columns: ["payment_id"]
            isOneToOne: false
            referencedRelation: "nexus_payments"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_payouts_talent_profile_id_fkey"
            columns: ["talent_profile_id"]
            isOneToOne: false
            referencedRelation: "nexus_talent_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_portfolio_items: {
        Row: {
          created_at: string
          description: string | null
          featured: boolean
          id: string
          image_url: string | null
          project_url: string | null
          skills_used: string[]
          title: string
          updated_at: string
          user_id: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          featured?: boolean
          id?: string
          image_url?: string | null
          project_url?: string | null
          skills_used?: string[]
          title: string
          updated_at?: string
          user_id: string
        }
        Update: {
          created_at?: string
          description?: string | null
          featured?: boolean
          id?: string
          image_url?: string | null
          project_url?: string | null
          skills_used?: string[]
          title?: string
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_portfolio_items_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_reviews: {
        Row: {
          application_id: string
          created_at: string
          creator_id: string
          id: string
          opportunity_id: string
          rating: number
          review_text: string | null
          reviewer_id: string
        }
        Insert: {
          application_id: string
          created_at?: string
          creator_id: string
          id?: string
          opportunity_id: string
          rating: number
          review_text?: string | null
          reviewer_id: string
        }
        Update: {
          application_id?: string
          created_at?: string
          creator_id?: string
          id?: string
          opportunity_id?: string
          rating?: number
          review_text?: string | null
          reviewer_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_reviews_application_id_fkey"
            columns: ["application_id"]
            isOneToOne: false
            referencedRelation: "nexus_applications"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_reviews_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_reviews_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "foundation_gig_radar"
            referencedColumns: ["opportunity_id"]
          },
          {
            foreignKeyName: "nexus_reviews_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "nexus_opportunities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_reviews_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_skill_endorsements: {
        Row: {
          created_at: string
          creator_id: string
          endorsed_by: string
          id: string
          skill: string
        }
        Insert: {
          created_at?: string
          creator_id: string
          endorsed_by: string
          id?: string
          skill: string
        }
        Update: {
          created_at?: string
          creator_id?: string
          endorsed_by?: string
          id?: string
          skill?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_skill_endorsements_creator_id_fkey"
            columns: ["creator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_skill_endorsements_endorsed_by_fkey"
            columns: ["endorsed_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_talent_profiles: {
        Row: {
          address_city: string | null
          address_line1_encrypted: string | null
          address_state: string | null
          address_zip: string | null
          az_eligible: boolean
          bank_account_connected: boolean
          compliance_expires_at: string | null
          compliance_status: string
          compliance_verified_at: string | null
          created_at: string
          id: string
          legal_first_name: string | null
          legal_last_name: string | null
          legal_name_encrypted: string | null
          payout_method: string | null
          residency_country: string
          residency_state: string | null
          stripe_connect_account_id: string | null
          tax_classification: string | null
          tax_id_encrypted: string | null
          tax_id_last_four: string | null
          updated_at: string
          user_id: string
          w9_submitted: boolean
          w9_submitted_at: string | null
        }
        Insert: {
          address_city?: string | null
          address_line1_encrypted?: string | null
          address_state?: string | null
          address_zip?: string | null
          az_eligible?: boolean
          bank_account_connected?: boolean
          compliance_expires_at?: string | null
          compliance_status?: string
          compliance_verified_at?: string | null
          created_at?: string
          id?: string
          legal_first_name?: string | null
          legal_last_name?: string | null
          legal_name_encrypted?: string | null
          payout_method?: string | null
          residency_country?: string
          residency_state?: string | null
          stripe_connect_account_id?: string | null
          tax_classification?: string | null
          tax_id_encrypted?: string | null
          tax_id_last_four?: string | null
          updated_at?: string
          user_id: string
          w9_submitted?: boolean
          w9_submitted_at?: string | null
        }
        Update: {
          address_city?: string | null
          address_line1_encrypted?: string | null
          address_state?: string | null
          address_zip?: string | null
          az_eligible?: boolean
          bank_account_connected?: boolean
          compliance_expires_at?: string | null
          compliance_status?: string
          compliance_verified_at?: string | null
          created_at?: string
          id?: string
          legal_first_name?: string | null
          legal_last_name?: string | null
          legal_name_encrypted?: string | null
          payout_method?: string | null
          residency_country?: string
          residency_state?: string | null
          stripe_connect_account_id?: string | null
          tax_classification?: string | null
          tax_id_encrypted?: string | null
          tax_id_last_four?: string | null
          updated_at?: string
          user_id?: string
          w9_submitted?: boolean
          w9_submitted_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "nexus_talent_profiles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_time_log_audits: {
        Row: {
          audit_type: string
          az_submission_id: string | null
          az_submission_response: Json | null
          az_submission_status: string | null
          corrections_made: Json | null
          created_at: string
          decision: string | null
          id: string
          ip_address: string | null
          notes: string | null
          reviewer_id: string | null
          time_log_id: string
          user_agent: string | null
        }
        Insert: {
          audit_type: string
          az_submission_id?: string | null
          az_submission_response?: Json | null
          az_submission_status?: string | null
          corrections_made?: Json | null
          created_at?: string
          decision?: string | null
          id?: string
          ip_address?: string | null
          notes?: string | null
          reviewer_id?: string | null
          time_log_id: string
          user_agent?: string | null
        }
        Update: {
          audit_type?: string
          az_submission_id?: string | null
          az_submission_response?: Json | null
          az_submission_status?: string | null
          corrections_made?: Json | null
          created_at?: string
          decision?: string | null
          id?: string
          ip_address?: string | null
          notes?: string | null
          reviewer_id?: string | null
          time_log_id?: string
          user_agent?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "nexus_time_log_audits_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_time_log_audits_time_log_id_fkey"
            columns: ["time_log_id"]
            isOneToOne: false
            referencedRelation: "nexus_time_logs"
            referencedColumns: ["id"]
          },
        ]
      }
      nexus_time_logs: {
        Row: {
          approved_at: string | null
          approved_by: string | null
          az_eligible_hours: number | null
          billable: boolean
          billed: boolean
          billed_at: string | null
          contract_id: string | null
          created_at: string
          description: string | null
          end_time: string
          hours_worked: number
          id: string
          invoice_id: string | null
          location_city: string | null
          location_latitude: number | null
          location_longitude: number | null
          location_state: string | null
          location_type: string
          location_verified: boolean
          log_date: string
          milestone_id: string | null
          start_time: string
          submission_status: string
          submitted_at: string | null
          talent_profile_id: string
          task_category: string | null
          tax_period: string | null
          updated_at: string
        }
        Insert: {
          approved_at?: string | null
          approved_by?: string | null
          az_eligible_hours?: number | null
          billable?: boolean
          billed?: boolean
          billed_at?: string | null
          contract_id?: string | null
          created_at?: string
          description?: string | null
          end_time: string
          hours_worked: number
          id?: string
          invoice_id?: string | null
          location_city?: string | null
          location_latitude?: number | null
          location_longitude?: number | null
          location_state?: string | null
          location_type?: string
          location_verified?: boolean
          log_date: string
          milestone_id?: string | null
          start_time: string
          submission_status?: string
          submitted_at?: string | null
          talent_profile_id: string
          task_category?: string | null
          tax_period?: string | null
          updated_at?: string
        }
        Update: {
          approved_at?: string | null
          approved_by?: string | null
          az_eligible_hours?: number | null
          billable?: boolean
          billed?: boolean
          billed_at?: string | null
          contract_id?: string | null
          created_at?: string
          description?: string | null
          end_time?: string
          hours_worked?: number
          id?: string
          invoice_id?: string | null
          location_city?: string | null
          location_latitude?: number | null
          location_longitude?: number | null
          location_state?: string | null
          location_type?: string
          location_verified?: boolean
          log_date?: string
          milestone_id?: string | null
          start_time?: string
          submission_status?: string
          submitted_at?: string | null
          talent_profile_id?: string
          task_category?: string | null
          tax_period?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "nexus_time_logs_approved_by_fkey"
            columns: ["approved_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_time_logs_contract_id_fkey"
            columns: ["contract_id"]
            isOneToOne: false
            referencedRelation: "nexus_contracts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_time_logs_invoice_id_fkey"
            columns: ["invoice_id"]
            isOneToOne: false
            referencedRelation: "corp_invoices"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_time_logs_milestone_id_fkey"
            columns: ["milestone_id"]
            isOneToOne: false
            referencedRelation: "nexus_milestones"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nexus_time_logs_talent_profile_id_fkey"
            columns: ["talent_profile_id"]
            isOneToOne: false
            referencedRelation: "nexus_talent_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      nft_assets: {
        Row: {
          animation_url: string | null
          attributes: Json | null
          cached_at: string | null
          chain_id: number
          collection_id: number | null
          contract_address: string
          created_at: string | null
          creator_address: string | null
          description: string | null
          external_url: string | null
          id: number
          image_url: string | null
          last_sale_date: string | null
          last_sale_price: number | null
          last_sale_price_currency: string | null
          metadata: Json | null
          name: string | null
          owner_address: string
          rarity_rank: number | null
          rarity_score: number | null
          token_id: string
          token_uri: string | null
          updated_at: string | null
        }
        Insert: {
          animation_url?: string | null
          attributes?: Json | null
          cached_at?: string | null
          chain_id: number
          collection_id?: number | null
          contract_address: string
          created_at?: string | null
          creator_address?: string | null
          description?: string | null
          external_url?: string | null
          id?: number
          image_url?: string | null
          last_sale_date?: string | null
          last_sale_price?: number | null
          last_sale_price_currency?: string | null
          metadata?: Json | null
          name?: string | null
          owner_address: string
          rarity_rank?: number | null
          rarity_score?: number | null
          token_id: string
          token_uri?: string | null
          updated_at?: string | null
        }
        Update: {
          animation_url?: string | null
          attributes?: Json | null
          cached_at?: string | null
          chain_id?: number
          collection_id?: number | null
          contract_address?: string
          created_at?: string | null
          creator_address?: string | null
          description?: string | null
          external_url?: string | null
          id?: number
          image_url?: string | null
          last_sale_date?: string | null
          last_sale_price?: number | null
          last_sale_price_currency?: string | null
          metadata?: Json | null
          name?: string | null
          owner_address?: string
          rarity_rank?: number | null
          rarity_score?: number | null
          token_id?: string
          token_uri?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "nft_assets_collection_id_fkey"
            columns: ["collection_id"]
            isOneToOne: false
            referencedRelation: "nft_collections"
            referencedColumns: ["id"]
          },
        ]
      }
      nft_collections: {
        Row: {
          banner_url: string | null
          chain_id: number
          contract_address: string
          created_at: string | null
          creator_address: string
          description: string | null
          floor_price: number | null
          floor_price_currency: string | null
          id: number
          image_url: string | null
          is_verified: boolean | null
          metadata: Json | null
          name: string
          owner_id: string | null
          royalty_address: string | null
          royalty_percentage: number | null
          social_links: Json | null
          symbol: string | null
          token_standard: string | null
          total_sales: number | null
          total_supply: number | null
          updated_at: string | null
          volume_traded: number | null
        }
        Insert: {
          banner_url?: string | null
          chain_id: number
          contract_address: string
          created_at?: string | null
          creator_address: string
          description?: string | null
          floor_price?: number | null
          floor_price_currency?: string | null
          id?: number
          image_url?: string | null
          is_verified?: boolean | null
          metadata?: Json | null
          name: string
          owner_id?: string | null
          royalty_address?: string | null
          royalty_percentage?: number | null
          social_links?: Json | null
          symbol?: string | null
          token_standard?: string | null
          total_sales?: number | null
          total_supply?: number | null
          updated_at?: string | null
          volume_traded?: number | null
        }
        Update: {
          banner_url?: string | null
          chain_id?: number
          contract_address?: string
          created_at?: string | null
          creator_address?: string
          description?: string | null
          floor_price?: number | null
          floor_price_currency?: string | null
          id?: number
          image_url?: string | null
          is_verified?: boolean | null
          metadata?: Json | null
          name?: string
          owner_id?: string | null
          royalty_address?: string | null
          royalty_percentage?: number | null
          social_links?: Json | null
          symbol?: string | null
          token_standard?: string | null
          total_sales?: number | null
          total_supply?: number | null
          updated_at?: string | null
          volume_traded?: number | null
        }
        Relationships: []
      }
      nft_sales: {
        Row: {
          asset_id: number | null
          auction_type: string | null
          block_number: number | null
          buyer_address: string | null
          chain_id: number
          collection_id: number | null
          contract_address: string
          created_at: string | null
          event_timestamp: string
          gas_fee: number | null
          id: number
          marketplace: string | null
          metadata: Json | null
          platform_address: string | null
          platform_fee: number | null
          price: number | null
          price_currency: string | null
          price_usd: number | null
          quantity: number | null
          royalty_fee: number | null
          sale_type: string | null
          seller_address: string | null
          token_id: string
          transaction_hash: string
        }
        Insert: {
          asset_id?: number | null
          auction_type?: string | null
          block_number?: number | null
          buyer_address?: string | null
          chain_id: number
          collection_id?: number | null
          contract_address: string
          created_at?: string | null
          event_timestamp: string
          gas_fee?: number | null
          id?: number
          marketplace?: string | null
          metadata?: Json | null
          platform_address?: string | null
          platform_fee?: number | null
          price?: number | null
          price_currency?: string | null
          price_usd?: number | null
          quantity?: number | null
          royalty_fee?: number | null
          sale_type?: string | null
          seller_address?: string | null
          token_id: string
          transaction_hash: string
        }
        Update: {
          asset_id?: number | null
          auction_type?: string | null
          block_number?: number | null
          buyer_address?: string | null
          chain_id?: number
          collection_id?: number | null
          contract_address?: string
          created_at?: string | null
          event_timestamp?: string
          gas_fee?: number | null
          id?: number
          marketplace?: string | null
          metadata?: Json | null
          platform_address?: string | null
          platform_fee?: number | null
          price?: number | null
          price_currency?: string | null
          price_usd?: number | null
          quantity?: number | null
          royalty_fee?: number | null
          sale_type?: string | null
          seller_address?: string | null
          token_id?: string
          transaction_hash?: string
        }
        Relationships: [
          {
            foreignKeyName: "nft_sales_asset_id_fkey"
            columns: ["asset_id"]
            isOneToOne: false
            referencedRelation: "nft_assets"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "nft_sales_collection_id_fkey"
            columns: ["collection_id"]
            isOneToOne: false
            referencedRelation: "nft_collections"
            referencedColumns: ["id"]
          },
        ]
      }
      nodes: {
        Row: {
          category: string | null
          content: string
          created_at: string | null
          details: string[] | null
          id: string
          status: string | null
          title: string
          type: string | null
          updated_at: string | null
          x: number
          y: number
          z: number | null
        }
        Insert: {
          category?: string | null
          content: string
          created_at?: string | null
          details?: string[] | null
          id?: string
          status?: string | null
          title: string
          type?: string | null
          updated_at?: string | null
          x: number
          y: number
          z?: number | null
        }
        Update: {
          category?: string | null
          content?: string
          created_at?: string | null
          details?: string[] | null
          id?: string
          status?: string | null
          title?: string
          type?: string | null
          updated_at?: string | null
          x?: number
          y?: number
          z?: number | null
        }
        Relationships: []
      }
      note: {
        Row: {
          created_at: number | null
          data: Json | null
          id: string
          meta: Json | null
          title: string | null
          updated_at: number | null
          user_id: string | null
        }
        Insert: {
          created_at?: number | null
          data?: Json | null
          id: string
          meta?: Json | null
          title?: string | null
          updated_at?: number | null
          user_id?: string | null
        }
        Update: {
          created_at?: number | null
          data?: Json | null
          id?: string
          meta?: Json | null
          title?: string | null
          updated_at?: number | null
          user_id?: string | null
        }
        Relationships: []
      }
      notification_preferences: {
        Row: {
          prefs: Json
          updated_at: string
          user_id: string
        }
        Insert: {
          prefs?: Json
          updated_at?: string
          user_id: string
        }
        Update: {
          prefs?: Json
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "notification_preferences_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      notifications: {
        Row: {
          created_at: string
          data: Json | null
          id: string
          is_read: boolean | null
          message: string | null
          read: boolean | null
          title: string | null
          type: string
          user_id: string
        }
        Insert: {
          created_at?: string
          data?: Json | null
          id?: string
          is_read?: boolean | null
          message?: string | null
          read?: boolean | null
          title?: string | null
          type: string
          user_id: string
        }
        Update: {
          created_at?: string
          data?: Json | null
          id?: string
          is_read?: boolean | null
          message?: string | null
          read?: boolean | null
          title?: string | null
          type?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "notifications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      now_playing: {
        Row: {
          album_art_url: string | null
          artist_name: string
          created_at: string
          id: string
          is_active: boolean | null
          site_id: string
          track_title: string
          track_url: string | null
        }
        Insert: {
          album_art_url?: string | null
          artist_name: string
          created_at?: string
          id?: string
          is_active?: boolean | null
          site_id: string
          track_title: string
          track_url?: string | null
        }
        Update: {
          album_art_url?: string | null
          artist_name?: string
          created_at?: string
          id?: string
          is_active?: boolean | null
          site_id?: string
          track_title?: string
          track_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "now_playing_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "now_playing_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      oakdale_applications: {
        Row: {
          age: string | null
          created_at: string | null
          discord_username: string
          experience: string | null
          id: string
          reviewed_by: string | null
          roblox_username: string
          status: string | null
          timezone: string | null
          why: string
        }
        Insert: {
          age?: string | null
          created_at?: string | null
          discord_username: string
          experience?: string | null
          id?: string
          reviewed_by?: string | null
          roblox_username: string
          status?: string | null
          timezone?: string | null
          why: string
        }
        Update: {
          age?: string | null
          created_at?: string | null
          discord_username?: string
          experience?: string | null
          id?: string
          reviewed_by?: string | null
          roblox_username?: string
          status?: string | null
          timezone?: string | null
          why?: string
        }
        Relationships: []
      }
      oakdale_events: {
        Row: {
          created_at: string | null
          description: string | null
          event_type: string | null
          id: string
          name: string
          rolling: boolean | null
          rolling_label: string | null
          starts_at: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          event_type?: string | null
          id?: string
          name: string
          rolling?: boolean | null
          rolling_label?: string | null
          starts_at?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          event_type?: string | null
          id?: string
          name?: string
          rolling?: boolean | null
          rolling_label?: string | null
          starts_at?: string | null
        }
        Relationships: []
      }
      oakdale_leaderboard: {
        Row: {
          event_type: string
          id: string
          roblox_user_id: number
          roblox_username: string
          score: number
          score_label: string | null
          updated_at: string | null
        }
        Insert: {
          event_type: string
          id?: string
          roblox_user_id: number
          roblox_username: string
          score: number
          score_label?: string | null
          updated_at?: string | null
        }
        Update: {
          event_type?: string
          id?: string
          roblox_user_id?: number
          roblox_username?: string
          score?: number
          score_label?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      oakdale_mod_log: {
        Row: {
          created_at: string | null
          duration_seconds: number | null
          id: string
          mod_discord_id: string
          mod_username: string
          reason: string | null
          target_roblox_id: number | null
          target_username: string
          type: string
        }
        Insert: {
          created_at?: string | null
          duration_seconds?: number | null
          id?: string
          mod_discord_id: string
          mod_username: string
          reason?: string | null
          target_roblox_id?: number | null
          target_username: string
          type: string
        }
        Update: {
          created_at?: string | null
          duration_seconds?: number | null
          id?: string
          mod_discord_id?: string
          mod_username?: string
          reason?: string | null
          target_roblox_id?: number | null
          target_username?: string
          type?: string
        }
        Relationships: []
      }
      oakdale_mod_notes: {
        Row: {
          body: string
          created_at: string | null
          id: string
          mod_discord_id: string
          mod_username: string
          target_username: string
        }
        Insert: {
          body: string
          created_at?: string | null
          id?: string
          mod_discord_id: string
          mod_username: string
          target_username: string
        }
        Update: {
          body?: string
          created_at?: string | null
          id?: string
          mod_discord_id?: string
          mod_username?: string
          target_username?: string
        }
        Relationships: []
      }
      oakdale_staff_roster: {
        Row: {
          added_at: string | null
          discord_username: string | null
          id: string
          rank: string | null
          roblox_user_id: number | null
          roblox_username: string
        }
        Insert: {
          added_at?: string | null
          discord_username?: string | null
          id?: string
          rank?: string | null
          roblox_user_id?: number | null
          roblox_username: string
        }
        Update: {
          added_at?: string | null
          discord_username?: string | null
          id?: string
          rank?: string | null
          roblox_user_id?: number | null
          roblox_username?: string
        }
        Relationships: []
      }
      oakdale_staff_sessions: {
        Row: {
          created_at: string | null
          discord_avatar: string | null
          discord_nick: string | null
          discord_user_id: string | null
          discord_username: string | null
          expires_at: string | null
          id: string
          rank: string | null
          token: string
        }
        Insert: {
          created_at?: string | null
          discord_avatar?: string | null
          discord_nick?: string | null
          discord_user_id?: string | null
          discord_username?: string | null
          expires_at?: string | null
          id?: string
          rank?: string | null
          token: string
        }
        Update: {
          created_at?: string | null
          discord_avatar?: string | null
          discord_nick?: string | null
          discord_user_id?: string | null
          discord_username?: string | null
          expires_at?: string | null
          id?: string
          rank?: string | null
          token?: string
        }
        Relationships: []
      }
      oakdale_tickets: {
        Row: {
          assigned_to: string | null
          body: string
          category: string
          created_at: string | null
          id: string
          roblox_username: string
          status: string | null
          subject: string
        }
        Insert: {
          assigned_to?: string | null
          body: string
          category: string
          created_at?: string | null
          id?: string
          roblox_username: string
          status?: string | null
          subject: string
        }
        Update: {
          assigned_to?: string | null
          body?: string
          category?: string
          created_at?: string | null
          id?: string
          roblox_username?: string
          status?: string | null
          subject?: string
        }
        Relationships: []
      }
      oauth_authorization_codes: {
        Row: {
          client_id: string
          code: string
          code_challenge: string | null
          code_challenge_method: string | null
          created_at: string | null
          expires_at: string
          id: string
          redirect_uri: string
          scope: string
          used: boolean
          user_id: string
        }
        Insert: {
          client_id: string
          code: string
          code_challenge?: string | null
          code_challenge_method?: string | null
          created_at?: string | null
          expires_at: string
          id?: string
          redirect_uri: string
          scope?: string
          used?: boolean
          user_id: string
        }
        Update: {
          client_id?: string
          code?: string
          code_challenge?: string | null
          code_challenge_method?: string | null
          created_at?: string | null
          expires_at?: string
          id?: string
          redirect_uri?: string
          scope?: string
          used?: boolean
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "oauth_authorization_codes_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "oauth_clients"
            referencedColumns: ["client_id"]
          },
        ]
      }
      oauth_clients: {
        Row: {
          allowed_scopes: string[]
          client_id: string
          client_secret: string | null
          created_at: string | null
          description: string | null
          id: string
          is_active: boolean
          is_trusted: boolean
          logo_url: string | null
          name: string
          redirect_uris: Json
          updated_at: string | null
          website_url: string | null
        }
        Insert: {
          allowed_scopes?: string[]
          client_id: string
          client_secret?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          is_active?: boolean
          is_trusted?: boolean
          logo_url?: string | null
          name: string
          redirect_uris?: Json
          updated_at?: string | null
          website_url?: string | null
        }
        Update: {
          allowed_scopes?: string[]
          client_id?: string
          client_secret?: string | null
          created_at?: string | null
          description?: string | null
          id?: string
          is_active?: boolean
          is_trusted?: boolean
          logo_url?: string | null
          name?: string
          redirect_uris?: Json
          updated_at?: string | null
          website_url?: string | null
        }
        Relationships: []
      }
      oauth_refresh_tokens: {
        Row: {
          client_id: string
          created_at: string | null
          expires_at: string
          id: string
          last_used_at: string | null
          revoked: boolean
          scope: string
          token: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          client_id: string
          created_at?: string | null
          expires_at: string
          id?: string
          last_used_at?: string | null
          revoked?: boolean
          scope?: string
          token: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          client_id?: string
          created_at?: string | null
          expires_at?: string
          id?: string
          last_used_at?: string | null
          revoked?: boolean
          scope?: string
          token?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "oauth_refresh_tokens_client_id_fkey"
            columns: ["client_id"]
            isOneToOne: false
            referencedRelation: "oauth_clients"
            referencedColumns: ["client_id"]
          },
        ]
      }
      oauth_session: {
        Row: {
          created_at: number
          expires_at: number
          id: string
          provider: string
          token: string
          updated_at: number
          user_id: string
        }
        Insert: {
          created_at: number
          expires_at: number
          id: string
          provider: string
          token: string
          updated_at: number
          user_id: string
        }
        Update: {
          created_at?: number
          expires_at?: number
          id?: string
          provider?: string
          token?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "oauth_session_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user"
            referencedColumns: ["id"]
          },
        ]
      }
      orders: {
        Row: {
          buyer_id: string
          created_at: string
          id: string
          listing_id: string
          price_at_purchase: number
          seller_id: string
          status: string
          stripe_account_id: string | null
          stripe_payment_intent_id: string | null
        }
        Insert: {
          buyer_id: string
          created_at?: string
          id?: string
          listing_id: string
          price_at_purchase: number
          seller_id: string
          status?: string
          stripe_account_id?: string | null
          stripe_payment_intent_id?: string | null
        }
        Update: {
          buyer_id?: string
          created_at?: string
          id?: string
          listing_id?: string
          price_at_purchase?: number
          seller_id?: string
          status?: string
          stripe_account_id?: string | null
          stripe_payment_intent_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "orders_buyer_id_fkey"
            columns: ["buyer_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "orders_listing_id_fkey"
            columns: ["listing_id"]
            isOneToOne: false
            referencedRelation: "listings"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "orders_seller_id_fkey"
            columns: ["seller_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      organization_members: {
        Row: {
          created_at: string | null
          id: string
          organization_id: string
          role: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          organization_id: string
          role?: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          id?: string
          organization_id?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "organization_members_organization_id_fkey"
            columns: ["organization_id"]
            isOneToOne: false
            referencedRelation: "organizations"
            referencedColumns: ["id"]
          },
        ]
      }
      organizations: {
        Row: {
          created_at: string | null
          id: string
          name: string
          owner_user_id: string
          plan: string | null
          slug: string
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          name: string
          owner_user_id: string
          plan?: string | null
          slug: string
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          name?: string
          owner_user_id?: string
          plan?: string | null
          slug?: string
          updated_at?: string | null
        }
        Relationships: []
      }
      pages: {
        Row: {
          content: Json | null
          created_at: string
          id: string
          slug: string
          title: string
          updated_at: string
        }
        Insert: {
          content?: Json | null
          created_at?: string
          id?: string
          slug: string
          title: string
          updated_at?: string
        }
        Update: {
          content?: Json | null
          created_at?: string
          id?: string
          slug?: string
          title?: string
          updated_at?: string
        }
        Relationships: []
      }
      pair_sessions: {
        Row: {
          created_at: string | null
          ended_at: string | null
          id: string
          initiator_id: string
          initiator_username: string
          partner_id: string | null
          partner_username: string | null
          session_type: string
          started_at: string | null
          status: string | null
        }
        Insert: {
          created_at?: string | null
          ended_at?: string | null
          id?: string
          initiator_id: string
          initiator_username: string
          partner_id?: string | null
          partner_username?: string | null
          session_type: string
          started_at?: string | null
          status?: string | null
        }
        Update: {
          created_at?: string | null
          ended_at?: string | null
          id?: string
          initiator_id?: string
          initiator_username?: string
          partner_id?: string | null
          partner_username?: string | null
          session_type?: string
          started_at?: string | null
          status?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "pair_sessions_initiator_id_fkey"
            columns: ["initiator_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "pair_sessions_partner_id_fkey"
            columns: ["partner_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      passport_audit_logs: {
        Row: {
          action: string
          created_at: string | null
          details: Json | null
          id: number
          ip_address: string | null
          user_agent: string | null
          user_id: string
        }
        Insert: {
          action: string
          created_at?: string | null
          details?: Json | null
          id?: number
          ip_address?: string | null
          user_agent?: string | null
          user_id: string
        }
        Update: {
          action?: string
          created_at?: string | null
          details?: Json | null
          id?: number
          ip_address?: string | null
          user_agent?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "passport_audit_logs_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "passport_users"
            referencedColumns: ["id"]
          },
        ]
      }
      passport_platforms: {
        Row: {
          connected_at: string | null
          id: number
          passport_user_id: string
          platform_name: string
          platform_user_id: string
          verification_token: string | null
        }
        Insert: {
          connected_at?: string | null
          id?: number
          passport_user_id: string
          platform_name: string
          platform_user_id: string
          verification_token?: string | null
        }
        Update: {
          connected_at?: string | null
          id?: number
          passport_user_id?: string
          platform_name?: string
          platform_user_id?: string
          verification_token?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "passport_platforms_passport_user_id_fkey"
            columns: ["passport_user_id"]
            isOneToOne: false
            referencedRelation: "passport_users"
            referencedColumns: ["id"]
          },
        ]
      }
      passport_scores: {
        Row: {
          created_at: string | null
          evidence: Json | null
          id: number
          last_updated: string | null
          score: number
          status: string | null
          user_id: string
          wallet_address: string
        }
        Insert: {
          created_at?: string | null
          evidence?: Json | null
          id?: number
          last_updated?: string | null
          score?: number
          status?: string | null
          user_id: string
          wallet_address: string
        }
        Update: {
          created_at?: string | null
          evidence?: Json | null
          id?: number
          last_updated?: string | null
          score?: number
          status?: string | null
          user_id?: string
          wallet_address?: string
        }
        Relationships: []
      }
      passport_users: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string | null
          display_name: string
          email: string
          email_verification_expires_at: string | null
          email_verification_token: string | null
          email_verified: boolean | null
          id: string
          password: string
          password_reset_expires_at: string | null
          password_reset_token: string | null
          updated_at: string | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          display_name: string
          email: string
          email_verification_expires_at?: string | null
          email_verification_token?: string | null
          email_verified?: boolean | null
          id: string
          password: string
          password_reset_expires_at?: string | null
          password_reset_token?: string | null
          updated_at?: string | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string | null
          display_name?: string
          email?: string
          email_verification_expires_at?: string | null
          email_verification_token?: string | null
          email_verified?: boolean | null
          id?: string
          password?: string
          password_reset_expires_at?: string | null
          password_reset_token?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      payment_transactions: {
        Row: {
          amount_usd: number
          created_at: string | null
          currency: string | null
          id: string
          metadata: Json | null
          status: string | null
          stripe_invoice_id: string | null
          stripe_payment_intent_id: string | null
          transaction_type: string | null
          user_id: string
        }
        Insert: {
          amount_usd: number
          created_at?: string | null
          currency?: string | null
          id?: string
          metadata?: Json | null
          status?: string | null
          stripe_invoice_id?: string | null
          stripe_payment_intent_id?: string | null
          transaction_type?: string | null
          user_id: string
        }
        Update: {
          amount_usd?: number
          created_at?: string | null
          currency?: string | null
          id?: string
          metadata?: Json | null
          status?: string | null
          stripe_invoice_id?: string | null
          stripe_payment_intent_id?: string | null
          transaction_type?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "payment_transactions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      payslips: {
        Row: {
          amount: number
          created_at: string | null
          file_url: string | null
          id: string
          pay_period_end: string
          pay_period_start: string
          site_id: string | null
          user_id: string | null
        }
        Insert: {
          amount: number
          created_at?: string | null
          file_url?: string | null
          id?: string
          pay_period_end: string
          pay_period_start: string
          site_id?: string | null
          user_id?: string | null
        }
        Update: {
          amount?: number
          created_at?: string | null
          file_url?: string | null
          id?: string
          pay_period_end?: string
          pay_period_start?: string
          site_id?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "payslips_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "payslips_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "payslips_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      performance_reviews: {
        Row: {
          comments: string | null
          created_at: string | null
          document_url: string | null
          id: string
          ratings: Json | null
          review_date: string
          reviewer_id: string | null
          site_id: string
          user_id: string
        }
        Insert: {
          comments?: string | null
          created_at?: string | null
          document_url?: string | null
          id?: string
          ratings?: Json | null
          review_date: string
          reviewer_id?: string | null
          site_id: string
          user_id: string
        }
        Update: {
          comments?: string | null
          created_at?: string | null
          document_url?: string | null
          id?: string
          ratings?: Json | null
          review_date?: string
          reviewer_id?: string | null
          site_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "performance_reviews_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "performance_reviews_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "performance_reviews_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "performance_reviews_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      permissions: {
        Row: {
          created_at: string
          description: string | null
          id: string
          name: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          name: string
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          name?: string
        }
        Relationships: []
      }
      personal_site_config: {
        Row: {
          created_at: string
          id: string
          site_id: string
          site_status: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          id?: string
          site_id: string
          site_status?: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          id?: string
          site_id?: string
          site_status?: string
          updated_at?: string
        }
        Relationships: []
      }
      player_unlocks: {
        Row: {
          achievement_id: string | null
          game_id: string | null
          id: string
          unlocked_at: string | null
          user_id: string | null
        }
        Insert: {
          achievement_id?: string | null
          game_id?: string | null
          id?: string
          unlocked_at?: string | null
          user_id?: string | null
        }
        Update: {
          achievement_id?: string | null
          game_id?: string | null
          id?: string
          unlocked_at?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "player_unlocks_achievement_id_fkey"
            columns: ["achievement_id"]
            isOneToOne: false
            referencedRelation: "game_achievements"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "player_unlocks_game_id_fkey"
            columns: ["game_id"]
            isOneToOne: false
            referencedRelation: "games"
            referencedColumns: ["id"]
          },
        ]
      }
      polls: {
        Row: {
          channel_id: string | null
          created_at: string | null
          created_by: string | null
          guild_id: string
          id: number
          message_id: string | null
          options: Json
          question: string
          votes: Json | null
        }
        Insert: {
          channel_id?: string | null
          created_at?: string | null
          created_by?: string | null
          guild_id: string
          id?: number
          message_id?: string | null
          options: Json
          question: string
          votes?: Json | null
        }
        Update: {
          channel_id?: string | null
          created_at?: string | null
          created_by?: string | null
          guild_id?: string
          id?: number
          message_id?: string | null
          options?: Json
          question?: string
          votes?: Json | null
        }
        Relationships: []
      }
      portfolio_projects: {
        Row: {
          content: Json | null
          cover_image_url: string | null
          created_at: string
          description: string | null
          github_url: string | null
          id: string
          live_url: string | null
          project_date: string | null
          site_id: string | null
          slug: string
          subtitle: string | null
          tags: string[] | null
          title: string
        }
        Insert: {
          content?: Json | null
          cover_image_url?: string | null
          created_at?: string
          description?: string | null
          github_url?: string | null
          id?: string
          live_url?: string | null
          project_date?: string | null
          site_id?: string | null
          slug: string
          subtitle?: string | null
          tags?: string[] | null
          title: string
        }
        Update: {
          content?: Json | null
          cover_image_url?: string | null
          created_at?: string
          description?: string | null
          github_url?: string | null
          id?: string
          live_url?: string | null
          project_date?: string | null
          site_id?: string | null
          slug?: string
          subtitle?: string | null
          tags?: string[] | null
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "portfolio_projects_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "portfolio_projects_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      post_likes: {
        Row: {
          created_at: string
          post_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          post_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          post_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "post_likes_post_id_fkey"
            columns: ["post_id"]
            isOneToOne: false
            referencedRelation: "posts"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "post_likes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      posts: {
        Row: {
          content: string
          created_at: string
          id: string
          media_url: string | null
          updated_at: string
          user_id: string
        }
        Insert: {
          content: string
          created_at?: string
          id?: string
          media_url?: string | null
          updated_at?: string
          user_id: string
        }
        Update: {
          content?: string
          created_at?: string
          id?: string
          media_url?: string | null
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "posts_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      premium_subscriptions: {
        Row: {
          cancel_at_period_end: boolean | null
          cancelled_at: string | null
          created_at: string | null
          current_period_end: string | null
          current_period_start: string | null
          id: string
          status: string | null
          stripe_customer_id: string | null
          stripe_subscription_id: string | null
          tier: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          cancel_at_period_end?: boolean | null
          cancelled_at?: string | null
          created_at?: string | null
          current_period_end?: string | null
          current_period_start?: string | null
          id?: string
          status?: string | null
          stripe_customer_id?: string | null
          stripe_subscription_id?: string | null
          tier: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          cancel_at_period_end?: boolean | null
          cancelled_at?: string | null
          created_at?: string | null
          current_period_end?: string | null
          current_period_start?: string | null
          id?: string
          status?: string | null
          stripe_customer_id?: string | null
          stripe_subscription_id?: string | null
          tier?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "premium_subscriptions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      products: {
        Row: {
          category: string | null
          created_at: string
          description: string | null
          display_order: number | null
          id: string
          image_prompt: string | null
          image_url: string | null
          name: string
          price: number | null
          rating: number | null
          site_id: string
          stock: number | null
          tags: string[] | null
          title: string
        }
        Insert: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          name: string
          price?: number | null
          rating?: number | null
          site_id: string
          stock?: number | null
          tags?: string[] | null
          title: string
        }
        Update: {
          category?: string | null
          created_at?: string
          description?: string | null
          display_order?: number | null
          id?: string
          image_prompt?: string | null
          image_url?: string | null
          name?: string
          price?: number | null
          rating?: number | null
          site_id?: string
          stock?: number | null
          tags?: string[] | null
          title?: string
        }
        Relationships: []
      }
      profiles: {
        Row: {
          active_title: string | null
          aethex_passport_id: string
          avatar_url: string | null
          banner_url: string | null
          bio: string | null
          created_at: string
          discord_user_id: string | null
          discord_username: string | null
          education: Json | null
          email: string | null
          experience: Json | null
          experience_level:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          featured_badge_ids: string[] | null
          full_name: string | null
          github_url: string | null
          id: string
          is_verified: boolean | null
          level: number | null
          linkedin_url: string | null
          location: string | null
          loyalty_points: number
          onboarded: boolean
          primary_role: string | null
          roblox_access_token: string | null
          roblox_refresh_token: string | null
          roblox_token_expires_at: string | null
          roblox_user_id: number | null
          role: string
          signature: string | null
          skills: string[] | null
          social_links: Json | null
          specialization: Json | null
          status: string | null
          suspended_at: string | null
          suspension_reason: string | null
          telemetry_api_key: string | null
          total_xp: number | null
          twitter_url: string | null
          updated_at: string
          user_type: Database["public"]["Enums"]["user_type_enum"] | null
          username: string
          website_url: string | null
        }
        Insert: {
          active_title?: string | null
          aethex_passport_id?: string
          avatar_url?: string | null
          banner_url?: string | null
          bio?: string | null
          created_at?: string
          discord_user_id?: string | null
          discord_username?: string | null
          education?: Json | null
          email?: string | null
          experience?: Json | null
          experience_level?:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          featured_badge_ids?: string[] | null
          full_name?: string | null
          github_url?: string | null
          id: string
          is_verified?: boolean | null
          level?: number | null
          linkedin_url?: string | null
          location?: string | null
          loyalty_points?: number
          onboarded?: boolean
          primary_role?: string | null
          roblox_access_token?: string | null
          roblox_refresh_token?: string | null
          roblox_token_expires_at?: string | null
          roblox_user_id?: number | null
          role?: string
          signature?: string | null
          skills?: string[] | null
          social_links?: Json | null
          specialization?: Json | null
          status?: string | null
          suspended_at?: string | null
          suspension_reason?: string | null
          telemetry_api_key?: string | null
          total_xp?: number | null
          twitter_url?: string | null
          updated_at?: string
          user_type?: Database["public"]["Enums"]["user_type_enum"] | null
          username: string
          website_url?: string | null
        }
        Update: {
          active_title?: string | null
          aethex_passport_id?: string
          avatar_url?: string | null
          banner_url?: string | null
          bio?: string | null
          created_at?: string
          discord_user_id?: string | null
          discord_username?: string | null
          education?: Json | null
          email?: string | null
          experience?: Json | null
          experience_level?:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          featured_badge_ids?: string[] | null
          full_name?: string | null
          github_url?: string | null
          id?: string
          is_verified?: boolean | null
          level?: number | null
          linkedin_url?: string | null
          location?: string | null
          loyalty_points?: number
          onboarded?: boolean
          primary_role?: string | null
          roblox_access_token?: string | null
          roblox_refresh_token?: string | null
          roblox_token_expires_at?: string | null
          roblox_user_id?: number | null
          role?: string
          signature?: string | null
          skills?: string[] | null
          social_links?: Json | null
          specialization?: Json | null
          status?: string | null
          suspended_at?: string | null
          suspension_reason?: string | null
          telemetry_api_key?: string | null
          total_xp?: number | null
          twitter_url?: string | null
          updated_at?: string
          user_type?: Database["public"]["Enums"]["user_type_enum"] | null
          username?: string
          website_url?: string | null
        }
        Relationships: []
      }
      project_collaborators: {
        Row: {
          created_at: string | null
          id: string
          permissions: Json | null
          project_id: string
          role: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          permissions?: Json | null
          project_id: string
          role?: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          id?: string
          permissions?: Json | null
          project_id?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "project_collaborators_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      project_members: {
        Row: {
          created_at: string
          project_id: string
          role: string
          user_id: string
        }
        Insert: {
          created_at?: string
          project_id: string
          role?: string
          user_id: string
        }
        Update: {
          created_at?: string
          project_id?: string
          role?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "project_members_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "project_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      project_tasks: {
        Row: {
          assignee_id: string | null
          created_at: string
          description: string | null
          due_date: string | null
          id: string
          project_id: string
          status: string
          title: string
          updated_at: string
        }
        Insert: {
          assignee_id?: string | null
          created_at?: string
          description?: string | null
          due_date?: string | null
          id?: string
          project_id: string
          status?: string
          title: string
          updated_at?: string
        }
        Update: {
          assignee_id?: string | null
          created_at?: string
          description?: string | null
          due_date?: string | null
          id?: string
          project_id?: string
          status?: string
          title?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "project_tasks_assignee_id_fkey"
            columns: ["assignee_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "project_tasks_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      project_team_members: {
        Row: {
          created_at: string | null
          id: string
          project_id: string | null
          role: string
          site_id: string | null
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          project_id?: string | null
          role: string
          site_id?: string | null
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          project_id?: string | null
          role?: string
          site_id?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "project_team_members_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "project_team_members_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      projects: {
        Row: {
          created_at: string | null
          description: string | null
          engine: string | null
          github_url: string | null
          id: string
          live_url: string | null
          organization_id: string | null
          owner_id: string | null
          owner_user_id: string | null
          priority: string | null
          progress: number | null
          site_id: string | null
          status: string | null
          technologies: string[] | null
          title: string
          updated_at: string | null
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          engine?: string | null
          github_url?: string | null
          id?: string
          live_url?: string | null
          organization_id?: string | null
          owner_id?: string | null
          owner_user_id?: string | null
          priority?: string | null
          progress?: number | null
          site_id?: string | null
          status?: string | null
          technologies?: string[] | null
          title: string
          updated_at?: string | null
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          engine?: string | null
          github_url?: string | null
          id?: string
          live_url?: string | null
          organization_id?: string | null
          owner_id?: string | null
          owner_user_id?: string | null
          priority?: string | null
          progress?: number | null
          site_id?: string | null
          status?: string | null
          technologies?: string[] | null
          title?: string
          updated_at?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "projects_organization_id_fkey"
            columns: ["organization_id"]
            isOneToOne: false
            referencedRelation: "organizations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "projects_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "projects_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "projects_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "projects_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      prompt: {
        Row: {
          command: string | null
          content: string
          created_at: number
          data: Json | null
          id: string
          is_active: boolean
          meta: Json | null
          name: string
          tags: Json | null
          updated_at: number
          user_id: string
          version_id: string | null
        }
        Insert: {
          command?: string | null
          content: string
          created_at: number
          data?: Json | null
          id: string
          is_active?: boolean
          meta?: Json | null
          name: string
          tags?: Json | null
          updated_at: number
          user_id: string
          version_id?: string | null
        }
        Update: {
          command?: string | null
          content?: string
          created_at?: number
          data?: Json | null
          id?: string
          is_active?: boolean
          meta?: Json | null
          name?: string
          tags?: Json | null
          updated_at?: number
          user_id?: string
          version_id?: string | null
        }
        Relationships: []
      }
      prompt_history: {
        Row: {
          commit_message: string | null
          created_at: number
          id: string
          parent_id: string | null
          prompt_id: string
          snapshot: Json
          user_id: string
        }
        Insert: {
          commit_message?: string | null
          created_at: number
          id: string
          parent_id?: string | null
          prompt_id: string
          snapshot: Json
          user_id: string
        }
        Update: {
          commit_message?: string | null
          created_at?: number
          id?: string
          parent_id?: string | null
          prompt_id?: string
          snapshot?: Json
          user_id?: string
        }
        Relationships: []
      }
      provider_identities: {
        Row: {
          id: string
          linked_at: string | null
          provider: string
          provider_data: Json | null
          provider_email: string | null
          provider_user_id: string
          user_id: string
        }
        Insert: {
          id?: string
          linked_at?: string | null
          provider: string
          provider_data?: Json | null
          provider_email?: string | null
          provider_user_id: string
          user_id: string
        }
        Update: {
          id?: string
          linked_at?: string | null
          provider?: string
          provider_data?: Json | null
          provider_email?: string | null
          provider_user_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "provider_identities_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      quests: {
        Row: {
          active: boolean | null
          created_at: string | null
          description: string | null
          expires_at: string | null
          guild_id: string
          id: number
          name: string
          quest_type: string | null
          starts_at: string | null
          target_value: number
          trigger_type: string
          xp_reward: number | null
        }
        Insert: {
          active?: boolean | null
          created_at?: string | null
          description?: string | null
          expires_at?: string | null
          guild_id: string
          id?: number
          name: string
          quest_type?: string | null
          starts_at?: string | null
          target_value: number
          trigger_type: string
          xp_reward?: number | null
        }
        Update: {
          active?: boolean | null
          created_at?: string | null
          description?: string | null
          expires_at?: string | null
          guild_id?: string
          id?: number
          name?: string
          quest_type?: string | null
          starts_at?: string | null
          target_value?: number
          trigger_type?: string
          xp_reward?: number | null
        }
        Relationships: []
      }
      raise_hand_requests: {
        Row: {
          acknowledged_at: string | null
          acknowledged_by: string | null
          channel_id: string | null
          created_at: string
          expires_at: string
          guild_id: string
          id: string
          reason: string | null
          status: string
          user_id: string
          username: string
          voice_channel_id: string | null
        }
        Insert: {
          acknowledged_at?: string | null
          acknowledged_by?: string | null
          channel_id?: string | null
          created_at?: string
          expires_at?: string
          guild_id: string
          id?: string
          reason?: string | null
          status?: string
          user_id: string
          username: string
          voice_channel_id?: string | null
        }
        Update: {
          acknowledged_at?: string | null
          acknowledged_by?: string | null
          channel_id?: string | null
          created_at?: string
          expires_at?: string
          guild_id?: string
          id?: string
          reason?: string | null
          status?: string
          user_id?: string
          username?: string
          voice_channel_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "raise_hand_requests_acknowledged_by_fkey"
            columns: ["acknowledged_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "raise_hand_requests_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      refresh_tokens: {
        Row: {
          created_at: string
          expires_at: string
          id: string
          token: string
          user_id: string
        }
        Insert: {
          created_at?: string
          expires_at: string
          id?: string
          token: string
          user_id: string
        }
        Update: {
          created_at?: string
          expires_at?: string
          id?: string
          token?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "refresh_tokens_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      reputation_events: {
        Row: {
          aethex_passport_id: string
          created_at: string
          event_type: string
          id: string
          metadata: Json | null
          points: number
          site_id: string | null
        }
        Insert: {
          aethex_passport_id: string
          created_at?: string
          event_type: string
          id?: string
          metadata?: Json | null
          points: number
          site_id?: string | null
        }
        Update: {
          aethex_passport_id?: string
          created_at?: string
          event_type?: string
          id?: string
          metadata?: Json | null
          points?: number
          site_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "reputation_events_aethex_passport_id_fkey"
            columns: ["aethex_passport_id"]
            isOneToOne: false
            referencedRelation: "aethex_passports"
            referencedColumns: ["id"]
          },
        ]
      }
      reputation_scores: {
        Row: {
          aethex_passport_id: string
          score: number
          updated_at: string | null
        }
        Insert: {
          aethex_passport_id: string
          score?: number
          updated_at?: string | null
        }
        Update: {
          aethex_passport_id?: string
          score?: number
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "reputation_scores_aethex_passport_id_fkey"
            columns: ["aethex_passport_id"]
            isOneToOne: true
            referencedRelation: "aethex_passports"
            referencedColumns: ["id"]
          },
        ]
      }
      reserved_handles: {
        Row: {
          handle: string
          id: number
          reason: string | null
          reserved_at: string | null
        }
        Insert: {
          handle: string
          id?: number
          reason?: string | null
          reserved_at?: string | null
        }
        Update: {
          handle?: string
          id?: number
          reason?: string | null
          reserved_at?: string | null
        }
        Relationships: []
      }
      resources: {
        Row: {
          category: string
          description: string
          download_count: number
          file_size_bytes: number | null
          file_type: string
          file_url: string
          id: string
          is_featured: boolean | null
          published_at: string | null
          published_by: string | null
          tags: string[] | null
          thumbnail_url: string | null
          title: string
          updated_at: string | null
        }
        Insert: {
          category: string
          description: string
          download_count?: number
          file_size_bytes?: number | null
          file_type: string
          file_url: string
          id?: string
          is_featured?: boolean | null
          published_at?: string | null
          published_by?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title: string
          updated_at?: string | null
        }
        Update: {
          category?: string
          description?: string
          download_count?: number
          file_size_bytes?: number | null
          file_type?: string
          file_url?: string
          id?: string
          is_featured?: boolean | null
          published_at?: string | null
          published_by?: string | null
          tags?: string[] | null
          thumbnail_url?: string | null
          title?: string
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "resources_published_by_fkey"
            columns: ["published_by"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      revenue_events: {
        Row: {
          created_at: string
          currency: string
          gross_amount: number
          id: string
          metadata: Json | null
          net_amount: number
          organization_id: string
          platform_fee: number
          project_id: string | null
          source_id: string
          source_type: string
        }
        Insert: {
          created_at?: string
          currency?: string
          gross_amount: number
          id?: string
          metadata?: Json | null
          net_amount: number
          organization_id: string
          platform_fee?: number
          project_id?: string | null
          source_id: string
          source_type: string
        }
        Update: {
          created_at?: string
          currency?: string
          gross_amount?: number
          id?: string
          metadata?: Json | null
          net_amount?: number
          organization_id?: string
          platform_fee?: number
          project_id?: string | null
          source_id?: string
          source_type?: string
        }
        Relationships: [
          {
            foreignKeyName: "revenue_events_organization_id_fkey"
            columns: ["organization_id"]
            isOneToOne: false
            referencedRelation: "organizations"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "revenue_events_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
        ]
      }
      reviews: {
        Row: {
          comment: string | null
          created_at: string
          id: string
          order_id: string
          rating: number
          reviewee_id: string
          reviewer_id: string
        }
        Insert: {
          comment?: string | null
          created_at?: string
          id?: string
          order_id: string
          rating: number
          reviewee_id: string
          reviewer_id: string
        }
        Update: {
          comment?: string | null
          created_at?: string
          id?: string
          order_id?: string
          rating?: number
          reviewee_id?: string
          reviewer_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "reviews_order_id_fkey"
            columns: ["order_id"]
            isOneToOne: false
            referencedRelation: "orders"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "reviews_reviewee_id_fkey"
            columns: ["reviewee_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "reviews_reviewer_id_fkey"
            columns: ["reviewer_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      reward_events: {
        Row: {
          amount: number
          created_at: string
          id: string
          metadata: Json | null
          points_kind: string
          type: string
          user_id: string
        }
        Insert: {
          amount?: number
          created_at?: string
          id?: string
          metadata?: Json | null
          points_kind?: string
          type: string
          user_id: string
        }
        Update: {
          amount?: number
          created_at?: string
          id?: string
          metadata?: Json | null
          points_kind?: string
          type?: string
          user_id?: string
        }
        Relationships: []
      }
      rewards: {
        Row: {
          bg_color: string | null
          color: string | null
          cost: number
          description: string | null
          id: string
          name: string
          rarity: string | null
          site_id: string | null
          stock: number | null
          title_id: string | null
          type: string
          value: Json | null
        }
        Insert: {
          bg_color?: string | null
          color?: string | null
          cost?: number
          description?: string | null
          id?: string
          name: string
          rarity?: string | null
          site_id?: string | null
          stock?: number | null
          title_id?: string | null
          type: string
          value?: Json | null
        }
        Update: {
          bg_color?: string | null
          color?: string | null
          cost?: number
          description?: string | null
          id?: string
          name?: string
          rarity?: string | null
          site_id?: string | null
          stock?: number | null
          title_id?: string | null
          type?: string
          value?: Json | null
        }
        Relationships: [
          {
            foreignKeyName: "rewards_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "rewards_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      roblox_links: {
        Row: {
          id: string
          last_verified: string | null
          linked_at: string | null
          roblox_user_id: string
          roblox_username: string
          user_id: string
        }
        Insert: {
          id?: string
          last_verified?: string | null
          linked_at?: string | null
          roblox_user_id: string
          roblox_username: string
          user_id: string
        }
        Update: {
          id?: string
          last_verified?: string | null
          linked_at?: string | null
          roblox_user_id?: string
          roblox_username?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "roblox_links_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      roblox_players: {
        Row: {
          created_at: string | null
          id: string
          passport_user_id: string | null
          roblox_user_id: number
          roblox_username: string
        }
        Insert: {
          created_at?: string | null
          id?: string
          passport_user_id?: string | null
          roblox_user_id: number
          roblox_username: string
        }
        Update: {
          created_at?: string | null
          id?: string
          passport_user_id?: string | null
          roblox_user_id?: number
          roblox_username?: string
        }
        Relationships: []
      }
      role_panels: {
        Row: {
          channel_id: string | null
          color: string | null
          created_at: string | null
          created_by: string | null
          description: string | null
          guild_id: string | null
          message_id: string
          roles: Json | null
          title: string | null
        }
        Insert: {
          channel_id?: string | null
          color?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          guild_id?: string | null
          message_id: string
          roles?: Json | null
          title?: string | null
        }
        Update: {
          channel_id?: string | null
          color?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          guild_id?: string | null
          message_id?: string
          roles?: Json | null
          title?: string | null
        }
        Relationships: []
      }
      role_permissions: {
        Row: {
          permission_id: string
          role_id: string
        }
        Insert: {
          permission_id: string
          role_id: string
        }
        Update: {
          permission_id?: string
          role_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "role_permissions_permission_id_fkey"
            columns: ["permission_id"]
            isOneToOne: false
            referencedRelation: "permissions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "role_permissions_role_id_fkey"
            columns: ["role_id"]
            isOneToOne: false
            referencedRelation: "roles"
            referencedColumns: ["id"]
          },
        ]
      }
      roles: {
        Row: {
          created_at: string
          description: string | null
          id: string
          name: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          name: string
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          name?: string
        }
        Relationships: []
      }
      saved_views: {
        Row: {
          camera_state: Json
          created_at: string | null
          description: string | null
          edge_style_property: string | null
          filters: Json | null
          hidden_edge_ids: string[] | null
          hidden_node_ids: string[] | null
          id: string
          layout_type: string
          name: string
          node_color_property: string | null
          node_size_property: string | null
          updated_at: string | null
          user_id: string | null
        }
        Insert: {
          camera_state: Json
          created_at?: string | null
          description?: string | null
          edge_style_property?: string | null
          filters?: Json | null
          hidden_edge_ids?: string[] | null
          hidden_node_ids?: string[] | null
          id?: string
          layout_type: string
          name: string
          node_color_property?: string | null
          node_size_property?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Update: {
          camera_state?: Json
          created_at?: string | null
          description?: string | null
          edge_style_property?: string | null
          filters?: Json | null
          hidden_edge_ids?: string[] | null
          hidden_node_ids?: string[] | null
          id?: string
          layout_type?: string
          name?: string
          node_color_property?: string | null
          node_size_property?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      scheduled_messages: {
        Row: {
          channel_id: string | null
          content: string | null
          created_at: string | null
          created_by: string | null
          embed_data: Json | null
          guild_id: string | null
          id: string
          send_time: string | null
          status: string | null
          type: string | null
        }
        Insert: {
          channel_id?: string | null
          content?: string | null
          created_at?: string | null
          created_by?: string | null
          embed_data?: Json | null
          guild_id?: string | null
          id: string
          send_time?: string | null
          status?: string | null
          type?: string | null
        }
        Update: {
          channel_id?: string | null
          content?: string | null
          created_at?: string | null
          created_by?: string | null
          embed_data?: Json | null
          guild_id?: string | null
          id?: string
          send_time?: string | null
          status?: string | null
          type?: string | null
        }
        Relationships: []
      }
      scrub_logs: {
        Row: {
          detection_count: number
          detection_types: string[] | null
          id: string
          ip_address: string | null
          original_length: number
          scrubbed_length: number
          status: string
          timestamp: string
          user_id: string | null
        }
        Insert: {
          detection_count?: number
          detection_types?: string[] | null
          id?: string
          ip_address?: string | null
          original_length: number
          scrubbed_length: number
          status: string
          timestamp?: string
          user_id?: string | null
        }
        Update: {
          detection_count?: number
          detection_types?: string[] | null
          id?: string
          ip_address?: string | null
          original_length?: number
          scrubbed_length?: number
          status?: string
          timestamp?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "scrub_logs_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      server_backups: {
        Row: {
          backup_data: Json
          backup_type: string | null
          channels_count: number | null
          created_at: string | null
          created_by: string | null
          description: string | null
          guild_id: string
          id: number
          name: string | null
          roles_count: number | null
          size_bytes: number | null
        }
        Insert: {
          backup_data: Json
          backup_type?: string | null
          channels_count?: number | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          guild_id: string
          id?: number
          name?: string | null
          roles_count?: number | null
          size_bytes?: number | null
        }
        Update: {
          backup_data?: Json
          backup_type?: string | null
          channels_count?: number | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          guild_id?: string
          id?: number
          name?: string | null
          roles_count?: number | null
          size_bytes?: number | null
        }
        Relationships: []
      }
      server_branding: {
        Row: {
          branding_enabled: boolean | null
          created_at: string | null
          created_by: string | null
          custom_bot_avatar_url: string | null
          custom_bot_name: string | null
          custom_embed_color: string | null
          custom_footer_text: string | null
          custom_handle: string | null
          guild_id: string
          handle_verified: boolean | null
          id: number
          landing_banner_url: string | null
          landing_description: string | null
          landing_features: Json | null
          landing_invite_url: string | null
          landing_social_links: Json | null
          landing_theme: string | null
          landing_title: string | null
          landing_website_url: string | null
          subscription_expires_at: string | null
          subscription_id: string | null
          subscription_started_at: string | null
          subscription_status: string | null
          tier: string | null
          updated_at: string | null
        }
        Insert: {
          branding_enabled?: boolean | null
          created_at?: string | null
          created_by?: string | null
          custom_bot_avatar_url?: string | null
          custom_bot_name?: string | null
          custom_embed_color?: string | null
          custom_footer_text?: string | null
          custom_handle?: string | null
          guild_id: string
          handle_verified?: boolean | null
          id?: number
          landing_banner_url?: string | null
          landing_description?: string | null
          landing_features?: Json | null
          landing_invite_url?: string | null
          landing_social_links?: Json | null
          landing_theme?: string | null
          landing_title?: string | null
          landing_website_url?: string | null
          subscription_expires_at?: string | null
          subscription_id?: string | null
          subscription_started_at?: string | null
          subscription_status?: string | null
          tier?: string | null
          updated_at?: string | null
        }
        Update: {
          branding_enabled?: boolean | null
          created_at?: string | null
          created_by?: string | null
          custom_bot_avatar_url?: string | null
          custom_bot_name?: string | null
          custom_embed_color?: string | null
          custom_footer_text?: string | null
          custom_handle?: string | null
          guild_id?: string
          handle_verified?: boolean | null
          id?: number
          landing_banner_url?: string | null
          landing_description?: string | null
          landing_features?: Json | null
          landing_invite_url?: string | null
          landing_social_links?: Json | null
          landing_theme?: string | null
          landing_title?: string | null
          landing_website_url?: string | null
          subscription_expires_at?: string | null
          subscription_id?: string | null
          subscription_started_at?: string | null
          subscription_status?: string | null
          tier?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      server_config: {
        Row: {
          auto_role: string | null
          goodbye_channel: string | null
          guild_id: string
          level_up_channel: string | null
          modlog_channel: string | null
          updated_at: string | null
          verified_role: string | null
          welcome_channel: string | null
        }
        Insert: {
          auto_role?: string | null
          goodbye_channel?: string | null
          guild_id: string
          level_up_channel?: string | null
          modlog_channel?: string | null
          updated_at?: string | null
          verified_role?: string | null
          welcome_channel?: string | null
        }
        Update: {
          auto_role?: string | null
          goodbye_channel?: string | null
          guild_id?: string
          level_up_channel?: string | null
          modlog_channel?: string | null
          updated_at?: string | null
          verified_role?: string | null
          welcome_channel?: string | null
        }
        Relationships: []
      }
      server_members: {
        Row: {
          id: string
          joined_at: string | null
          nickname: string | null
          role: string | null
          server_id: string
          user_id: string
        }
        Insert: {
          id?: string
          joined_at?: string | null
          nickname?: string | null
          role?: string | null
          server_id: string
          user_id: string
        }
        Update: {
          id?: string
          joined_at?: string | null
          nickname?: string | null
          role?: string | null
          server_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "server_members_server_id_fkey"
            columns: ["server_id"]
            isOneToOne: false
            referencedRelation: "servers"
            referencedColumns: ["id"]
          },
        ]
      }
      servers: {
        Row: {
          banner_url: string | null
          created_at: string | null
          description: string | null
          icon_url: string | null
          id: string
          invite_code: string | null
          is_public: boolean | null
          member_count: number | null
          name: string
          owner_id: string
          updated_at: string | null
        }
        Insert: {
          banner_url?: string | null
          created_at?: string | null
          description?: string | null
          icon_url?: string | null
          id?: string
          invite_code?: string | null
          is_public?: boolean | null
          member_count?: number | null
          name: string
          owner_id: string
          updated_at?: string | null
        }
        Update: {
          banner_url?: string | null
          created_at?: string | null
          description?: string | null
          icon_url?: string | null
          id?: string
          invite_code?: string | null
          is_public?: boolean | null
          member_count?: number | null
          name?: string
          owner_id?: string
          updated_at?: string | null
        }
        Relationships: []
      }
      service_inquiries: {
        Row: {
          created_at: string
          email: string
          id: string
          message: string | null
          name: string
          service_id: string
          service_title: string
          status: string
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          message?: string | null
          name: string
          service_id: string
          service_title: string
          status?: string
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          message?: string | null
          name?: string
          service_id?: string
          service_title?: string
          status?: string
        }
        Relationships: [
          {
            foreignKeyName: "fk_service"
            columns: ["service_id"]
            isOneToOne: false
            referencedRelation: "consultancy_services"
            referencedColumns: ["id"]
          },
        ]
      }
      sessions: {
        Row: {
          created_at: string
          expires_at: string
          id: string
          token: string
          user_id: string
          username: string
        }
        Insert: {
          created_at?: string
          expires_at: string
          id?: string
          token: string
          user_id: string
          username: string
        }
        Update: {
          created_at?: string
          expires_at?: string
          id?: string
          token?: string
          user_id?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "sessions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      ship_notes: {
        Row: {
          bounty_id: string | null
          content: string
          created_at: string
          guild_id: string | null
          id: string
          reactions: Json | null
          user_id: string
          username: string
        }
        Insert: {
          bounty_id?: string | null
          content: string
          created_at?: string
          guild_id?: string | null
          id?: string
          reactions?: Json | null
          user_id: string
          username: string
        }
        Update: {
          bounty_id?: string | null
          content?: string
          created_at?: string
          guild_id?: string | null
          id?: string
          reactions?: Json | null
          user_id?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "ship_notes_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      shop_items: {
        Row: {
          created_at: string | null
          description: string | null
          enabled: boolean | null
          guild_id: string
          id: number
          item_data: Json | null
          item_type: string
          name: string
          price: number
          stock: number | null
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          enabled?: boolean | null
          guild_id: string
          id?: number
          item_data?: Json | null
          item_type: string
          name: string
          price: number
          stock?: number | null
        }
        Update: {
          created_at?: string | null
          description?: string | null
          enabled?: boolean | null
          guild_id?: string
          id?: number
          item_data?: Json | null
          item_type?: string
          name?: string
          price?: number
          stock?: number | null
        }
        Relationships: []
      }
      shorts: {
        Row: {
          comments_count: number
          created_at: string
          description: string | null
          id: string
          likes_count: number
          shares_count: number
          updated_at: string
          user_id: string
          video_url: string
        }
        Insert: {
          comments_count?: number
          created_at?: string
          description?: string | null
          id?: string
          likes_count?: number
          shares_count?: number
          updated_at?: string
          user_id: string
          video_url: string
        }
        Update: {
          comments_count?: number
          created_at?: string
          description?: string | null
          id?: string
          likes_count?: number
          shares_count?: number
          updated_at?: string
          user_id?: string
          video_url?: string
        }
        Relationships: [
          {
            foreignKeyName: "shorts_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      shoutouts: {
        Row: {
          channel_id: string | null
          created_at: string
          emoji: string | null
          from_user_id: string
          from_username: string
          guild_id: string | null
          id: string
          message: string | null
          to_user_id: string
          to_username: string
        }
        Insert: {
          channel_id?: string | null
          created_at?: string
          emoji?: string | null
          from_user_id: string
          from_username: string
          guild_id?: string | null
          id?: string
          message?: string | null
          to_user_id: string
          to_username: string
        }
        Update: {
          channel_id?: string | null
          created_at?: string
          emoji?: string | null
          from_user_id?: string
          from_username?: string
          guild_id?: string | null
          id?: string
          message?: string | null
          to_user_id?: string
          to_username?: string
        }
        Relationships: [
          {
            foreignKeyName: "shoutouts_from_user_id_fkey"
            columns: ["from_user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "shoutouts_to_user_id_fkey"
            columns: ["to_user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      showcase_contributors: {
        Row: {
          avatar: string | null
          id: string
          name: string
          project_id: string
          title: string | null
        }
        Insert: {
          avatar?: string | null
          id?: string
          name: string
          project_id: string
          title?: string | null
        }
        Update: {
          avatar?: string | null
          id?: string
          name?: string
          project_id?: string
          title?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "showcase_contributors_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "showcase_projects"
            referencedColumns: ["id"]
          },
        ]
      }
      showcase_project_links: {
        Row: {
          href: string
          id: string
          label: string
          project_id: string
        }
        Insert: {
          href: string
          id?: string
          label: string
          project_id: string
        }
        Update: {
          href?: string
          id?: string
          label?: string
          project_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "showcase_project_links_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "showcase_projects"
            referencedColumns: ["id"]
          },
        ]
      }
      showcase_projects: {
        Row: {
          created_at: string
          description: string | null
          id: string
          image: string | null
          org_unit: string | null
          role: string | null
          tags: string[]
          timeframe: string | null
          title: string
          updated_at: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          image?: string | null
          org_unit?: string | null
          role?: string | null
          tags?: string[]
          timeframe?: string | null
          title: string
          updated_at?: string
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          image?: string | null
          org_unit?: string | null
          role?: string | null
          tags?: string[]
          timeframe?: string | null
          title?: string
          updated_at?: string
        }
        Relationships: []
      }
      site_config: {
        Row: {
          created_at: string
          favicon_url: string | null
          id: string
          logo_url: string | null
          maintenance_ends_at: string | null
          maintenance_mode: boolean | null
          primary_color: string | null
          secondary_color: string | null
          site_description: string | null
          site_id: string
          site_name: string | null
          status_updates: Json | null
          system_status: string
          system_status_message: string | null
          updated_at: string
        }
        Insert: {
          created_at?: string
          favicon_url?: string | null
          id?: string
          logo_url?: string | null
          maintenance_ends_at?: string | null
          maintenance_mode?: boolean | null
          primary_color?: string | null
          secondary_color?: string | null
          site_description?: string | null
          site_id: string
          site_name?: string | null
          status_updates?: Json | null
          system_status?: string
          system_status_message?: string | null
          updated_at?: string
        }
        Update: {
          created_at?: string
          favicon_url?: string | null
          id?: string
          logo_url?: string | null
          maintenance_ends_at?: string | null
          maintenance_mode?: boolean | null
          primary_color?: string | null
          secondary_color?: string | null
          site_description?: string | null
          site_id?: string
          site_name?: string | null
          status_updates?: Json | null
          system_status?: string
          system_status_message?: string | null
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: true
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: true
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      site_context: {
        Row: {
          created_at: string
          id: string
          role: string
          site_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          role?: string
          site_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          id?: string
          role?: string
          site_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "site_context_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      site_metrics: {
        Row: {
          created_at: string
          display_order: number | null
          id: string
          metric_name: string
          metric_value: string
          site_id: string
        }
        Insert: {
          created_at?: string
          display_order?: number | null
          id?: string
          metric_name: string
          metric_value: string
          site_id: string
        }
        Update: {
          created_at?: string
          display_order?: number | null
          id?: string
          metric_name?: string
          metric_value?: string
          site_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_site_id"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      site_settings: {
        Row: {
          key: string
          updated_at: string
          value: Json
        }
        Insert: {
          key: string
          updated_at?: string
          value?: Json
        }
        Update: {
          key?: string
          updated_at?: string
          value?: Json
        }
        Relationships: []
      }
      skill: {
        Row: {
          content: string
          created_at: number
          description: string | null
          id: string
          is_active: boolean
          meta: Json | null
          name: string
          updated_at: number
          user_id: string
        }
        Insert: {
          content: string
          created_at: number
          description?: string | null
          id: string
          is_active: boolean
          meta?: Json | null
          name: string
          updated_at: number
          user_id: string
        }
        Update: {
          content?: string
          created_at?: number
          description?: string | null
          id?: string
          is_active?: boolean
          meta?: Json | null
          name?: string
          updated_at?: number
          user_id?: string
        }
        Relationships: []
      }
      social_links: {
        Row: {
          created_at: string
          display_order: number | null
          icon: string
          id: string
          name: string
          site_id: string
          url: string
        }
        Insert: {
          created_at?: string
          display_order?: number | null
          icon: string
          id?: string
          name: string
          site_id: string
          url: string
        }
        Update: {
          created_at?: string
          display_order?: number | null
          icon?: string
          id?: string
          name?: string
          site_id?: string
          url?: string
        }
        Relationships: []
      }
      sponsors: {
        Row: {
          created_at: string
          display_order: number | null
          id: string
          logo_url: string | null
          name: string
          site_id: string
          website_url: string | null
        }
        Insert: {
          created_at?: string
          display_order?: number | null
          id?: string
          logo_url?: string | null
          name: string
          site_id: string
          website_url?: string | null
        }
        Update: {
          created_at?: string
          display_order?: number | null
          id?: string
          logo_url?: string | null
          name?: string
          site_id?: string
          website_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "fk_site"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "fk_site"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      sprints: {
        Row: {
          completed_points: number | null
          created_at: string | null
          description: string | null
          end_date: string
          id: string
          name: string
          start_date: string
          status: string | null
          total_points: number | null
          updated_at: string | null
        }
        Insert: {
          completed_points?: number | null
          created_at?: string | null
          description?: string | null
          end_date: string
          id?: string
          name: string
          start_date: string
          status?: string | null
          total_points?: number | null
          updated_at?: string | null
        }
        Update: {
          completed_points?: number | null
          created_at?: string | null
          description?: string | null
          end_date?: string
          id?: string
          name?: string
          start_date?: string
          status?: string | null
          total_points?: number | null
          updated_at?: string | null
        }
        Relationships: []
      }
      staff_contractors: {
        Row: {
          avatar_url: string | null
          company: string | null
          contract_type: string | null
          created_at: string | null
          email: string
          end_date: string | null
          full_name: string
          id: string
          is_active: boolean | null
          location: string | null
          phone: string | null
          position: string | null
          start_date: string | null
          updated_at: string | null
          user_id: string | null
        }
        Insert: {
          avatar_url?: string | null
          company?: string | null
          contract_type?: string | null
          created_at?: string | null
          email: string
          end_date?: string | null
          full_name: string
          id?: string
          is_active?: boolean | null
          location?: string | null
          phone?: string | null
          position?: string | null
          start_date?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Update: {
          avatar_url?: string | null
          company?: string | null
          contract_type?: string | null
          created_at?: string | null
          email?: string
          end_date?: string | null
          full_name?: string
          id?: string
          is_active?: boolean | null
          location?: string | null
          phone?: string | null
          position?: string | null
          start_date?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      staff_members: {
        Row: {
          avatar_url: string | null
          created_at: string | null
          department: string | null
          email: string
          full_name: string
          hired_date: string | null
          id: string
          is_active: boolean | null
          location: string | null
          phone: string | null
          position: string | null
          role: string | null
          updated_at: string | null
          user_id: string | null
        }
        Insert: {
          avatar_url?: string | null
          created_at?: string | null
          department?: string | null
          email: string
          full_name: string
          hired_date?: string | null
          id?: string
          is_active?: boolean | null
          location?: string | null
          phone?: string | null
          position?: string | null
          role?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Update: {
          avatar_url?: string | null
          created_at?: string | null
          department?: string | null
          email?: string
          full_name?: string
          hired_date?: string | null
          id?: string
          is_active?: boolean | null
          location?: string | null
          phone?: string | null
          position?: string | null
          role?: string | null
          updated_at?: string | null
          user_id?: string | null
        }
        Relationships: []
      }
      stripe_accounts: {
        Row: {
          charges_enabled: boolean
          created_at: string
          details_submitted: boolean
          id: string
          payouts_enabled: boolean
          stripe_account_id: string
          updated_at: string
        }
        Insert: {
          charges_enabled?: boolean
          created_at?: string
          details_submitted?: boolean
          id: string
          payouts_enabled?: boolean
          stripe_account_id: string
          updated_at?: string
        }
        Update: {
          charges_enabled?: boolean
          created_at?: string
          details_submitted?: boolean
          id?: string
          payouts_enabled?: boolean
          stripe_account_id?: string
          updated_at?: string
        }
        Relationships: [
          {
            foreignKeyName: "stripe_accounts_id_fkey"
            columns: ["id"]
            isOneToOne: true
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      studio_projects: {
        Row: {
          created_at: string | null
          description: string | null
          id: string
          likes: number | null
          title: string
          user_id: string
        }
        Insert: {
          created_at?: string | null
          description?: string | null
          id?: string
          likes?: number | null
          title: string
          user_id: string
        }
        Update: {
          created_at?: string | null
          description?: string | null
          id?: string
          likes?: number | null
          title?: string
          user_id?: string
        }
        Relationships: []
      }
      subscriptions: {
        Row: {
          created_at: string | null
          email: string
          id: number
          status: string | null
          updated_at: string | null
        }
        Insert: {
          created_at?: string | null
          email: string
          id?: number
          status?: string | null
          updated_at?: string | null
        }
        Update: {
          created_at?: string | null
          email?: string
          id?: number
          status?: string | null
          updated_at?: string | null
        }
        Relationships: []
      }
      survey_responses: {
        Row: {
          id: string
          responses: Json | null
          submitted_at: string | null
          survey_id: string
          user_id: string
        }
        Insert: {
          id?: string
          responses?: Json | null
          submitted_at?: string | null
          survey_id: string
          user_id: string
        }
        Update: {
          id?: string
          responses?: Json | null
          submitted_at?: string | null
          survey_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "survey_responses_survey_id_fkey"
            columns: ["survey_id"]
            isOneToOne: false
            referencedRelation: "feedback_surveys"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "survey_responses_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      system_settings: {
        Row: {
          created_at: string | null
          key: string
          updated_at: string | null
          value: Json | null
        }
        Insert: {
          created_at?: string | null
          key: string
          updated_at?: string | null
          value?: Json | null
        }
        Update: {
          created_at?: string | null
          key?: string
          updated_at?: string | null
          value?: Json | null
        }
        Relationships: []
      }
      tag: {
        Row: {
          id: string
          meta: Json | null
          name: string
          user_id: string
        }
        Insert: {
          id: string
          meta?: Json | null
          name: string
          user_id: string
        }
        Update: {
          id?: string
          meta?: Json | null
          name?: string
          user_id?: string
        }
        Relationships: []
      }
      team_activity_log: {
        Row: {
          activity_metadata: Json | null
          activity_type: string
          created_at: string | null
          id: string
          points: number | null
          user_id: string
          username: string
        }
        Insert: {
          activity_metadata?: Json | null
          activity_type: string
          created_at?: string | null
          id?: string
          points?: number | null
          user_id: string
          username: string
        }
        Update: {
          activity_metadata?: Json | null
          activity_type?: string
          created_at?: string | null
          id?: string
          points?: number | null
          user_id?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "team_activity_log_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      team_members: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string
          id: string
          name: string
          order_index: number | null
          profile_id: string | null
          role: string
          social_links: Json | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          id?: string
          name: string
          order_index?: number | null
          profile_id?: string | null
          role: string
          social_links?: Json | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          id?: string
          name?: string
          order_index?: number | null
          profile_id?: string | null
          role?: string
          social_links?: Json | null
        }
        Relationships: [
          {
            foreignKeyName: "team_members_profile_id_fkey"
            columns: ["profile_id"]
            isOneToOne: true
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      team_memberships: {
        Row: {
          created_at: string
          role: string
          status: string
          team_id: string
          user_id: string
        }
        Insert: {
          created_at?: string
          role?: string
          status?: string
          team_id: string
          user_id: string
        }
        Update: {
          created_at?: string
          role?: string
          status?: string
          team_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "team_memberships_team_id_fkey"
            columns: ["team_id"]
            isOneToOne: false
            referencedRelation: "teams"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "team_memberships_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      team_presence: {
        Row: {
          created_at: string | null
          discord_user_id: string
          discord_username: string
          id: string
          is_online: boolean | null
          last_seen: string | null
          status: string | null
          updated_at: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          discord_user_id: string
          discord_username: string
          id?: string
          is_online?: boolean | null
          last_seen?: string | null
          status?: string | null
          updated_at?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          discord_user_id?: string
          discord_username?: string
          id?: string
          is_online?: boolean | null
          last_seen?: string | null
          status?: string | null
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "team_presence_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      teams: {
        Row: {
          created_at: string
          description: string | null
          id: string
          name: string
          owner_id: string
          slug: string | null
          updated_at: string
          visibility: string
        }
        Insert: {
          created_at?: string
          description?: string | null
          id?: string
          name: string
          owner_id: string
          slug?: string | null
          updated_at?: string
          visibility?: string
        }
        Update: {
          created_at?: string
          description?: string | null
          id?: string
          name?: string
          owner_id?: string
          slug?: string | null
          updated_at?: string
          visibility?: string
        }
        Relationships: [
          {
            foreignKeyName: "teams_owner_id_fkey"
            columns: ["owner_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      tickets: {
        Row: {
          assigned_to: string | null
          created_at: string | null
          created_by: string | null
          description: string | null
          id: string
          priority: string | null
          project_id: string | null
          site_id: string | null
          status: string | null
          title: string
          type: string | null
          updated_at: string | null
        }
        Insert: {
          assigned_to?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          id?: string
          priority?: string | null
          project_id?: string | null
          site_id?: string | null
          status?: string | null
          title: string
          type?: string | null
          updated_at?: string | null
        }
        Update: {
          assigned_to?: string | null
          created_at?: string | null
          created_by?: string | null
          description?: string | null
          id?: string
          priority?: string | null
          project_id?: string | null
          site_id?: string | null
          status?: string | null
          title?: string
          type?: string | null
          updated_at?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "tickets_assigned_to_fkey"
            columns: ["assigned_to"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tickets_created_by_fkey"
            columns: ["created_by"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tickets_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tickets_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "tickets_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
        ]
      }
      time_off_requests: {
        Row: {
          created_at: string | null
          end_date: string
          id: string
          reason: string | null
          site_id: string | null
          start_date: string
          status: string | null
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          end_date: string
          id?: string
          reason?: string | null
          site_id?: string | null
          start_date: string
          status?: string | null
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          end_date?: string
          id?: string
          reason?: string | null
          site_id?: string | null
          start_date?: string
          status?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "time_off_requests_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "time_off_requests_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "time_off_requests_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      time_tracking: {
        Row: {
          clock_in: string
          clock_out: string | null
          created_at: string | null
          id: string
          notes: string | null
          site_id: string | null
          user_id: string | null
        }
        Insert: {
          clock_in: string
          clock_out?: string | null
          created_at?: string | null
          id?: string
          notes?: string | null
          site_id?: string | null
          user_id?: string | null
        }
        Update: {
          clock_in?: string
          clock_out?: string | null
          created_at?: string | null
          id?: string
          notes?: string | null
          site_id?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "time_tracking_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "aethex_sites"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "time_tracking_site_id_fkey"
            columns: ["site_id"]
            isOneToOne: false
            referencedRelation: "crm_site_config_view"
            referencedColumns: ["site_id"]
          },
          {
            foreignKeyName: "time_tracking_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      timesheet_entries: {
        Row: {
          approved_at: string | null
          approved_by: string | null
          billable_hours: number | null
          created_at: string | null
          exported_to_nexus: boolean | null
          id: string
          nexus_sync_at: string | null
          status: string | null
          total_hours: number
          user_id: string
          work_date: string
        }
        Insert: {
          approved_at?: string | null
          approved_by?: string | null
          billable_hours?: number | null
          created_at?: string | null
          exported_to_nexus?: boolean | null
          id?: string
          nexus_sync_at?: string | null
          status?: string | null
          total_hours: number
          user_id: string
          work_date: string
        }
        Update: {
          approved_at?: string | null
          approved_by?: string | null
          billable_hours?: number | null
          created_at?: string | null
          exported_to_nexus?: boolean | null
          id?: string
          nexus_sync_at?: string | null
          status?: string | null
          total_hours?: number
          user_id?: string
          work_date?: string
        }
        Relationships: []
      }
      token_balances: {
        Row: {
          balance: number
          balance_usd: number | null
          chain_id: number
          created_at: string | null
          id: number
          last_synced_at: string | null
          price_usd: number | null
          token_address: string | null
          token_decimals: number | null
          token_name: string | null
          token_symbol: string
          user_id: string
          wallet_address: string
        }
        Insert: {
          balance?: number
          balance_usd?: number | null
          chain_id: number
          created_at?: string | null
          id?: number
          last_synced_at?: string | null
          price_usd?: number | null
          token_address?: string | null
          token_decimals?: number | null
          token_name?: string | null
          token_symbol: string
          user_id: string
          wallet_address: string
        }
        Update: {
          balance?: number
          balance_usd?: number | null
          chain_id?: number
          created_at?: string | null
          id?: number
          last_synced_at?: string | null
          price_usd?: number | null
          token_address?: string | null
          token_decimals?: number | null
          token_name?: string | null
          token_symbol?: string
          user_id?: string
          wallet_address?: string
        }
        Relationships: []
      }
      tool: {
        Row: {
          content: string
          created_at: number
          id: string
          meta: string
          name: string
          specs: string
          updated_at: number
          user_id: string
          valves: string | null
        }
        Insert: {
          content: string
          created_at: number
          id: string
          meta: string
          name: string
          specs: string
          updated_at: number
          user_id: string
          valves?: string | null
        }
        Update: {
          content?: string
          created_at?: number
          id?: string
          meta?: string
          name?: string
          specs?: string
          updated_at?: number
          user_id?: string
          valves?: string | null
        }
        Relationships: []
      }
      trinity_stats: {
        Row: {
          division: string
          id: string
          metric: string
          updated_at: string | null
          value: number | null
        }
        Insert: {
          division: string
          id?: string
          metric: string
          updated_at?: string | null
          value?: number | null
        }
        Update: {
          division?: string
          id?: string
          metric?: string
          updated_at?: string | null
          value?: number | null
        }
        Relationships: []
      }
      turn_credentials: {
        Row: {
          created_at: string | null
          credential: string
          expires_at: string
          id: string
          user_id: string
          username: string
        }
        Insert: {
          created_at?: string | null
          credential: string
          expires_at: string
          id?: string
          user_id: string
          username: string
        }
        Update: {
          created_at?: string | null
          credential?: string
          expires_at?: string
          id?: string
          user_id?: string
          username?: string
        }
        Relationships: []
      }
      two_factor_auth: {
        Row: {
          backup_codes: Json | null
          created_at: string | null
          id: string
          is_enabled: boolean
          secret: string
          updated_at: string | null
          user_id: string
        }
        Insert: {
          backup_codes?: Json | null
          created_at?: string | null
          id?: string
          is_enabled?: boolean
          secret: string
          updated_at?: string | null
          user_id: string
        }
        Update: {
          backup_codes?: Json | null
          created_at?: string | null
          id?: string
          is_enabled?: boolean
          secret?: string
          updated_at?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "two_factor_auth_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      type_racer_games: {
        Row: {
          accuracy: number
          challenge_text: string
          created_at: string | null
          id: string
          is_practice: boolean | null
          placement: number | null
          race_id: string | null
          time_seconds: number
          user_id: string
          username: string
          wpm: number
        }
        Insert: {
          accuracy: number
          challenge_text: string
          created_at?: string | null
          id?: string
          is_practice?: boolean | null
          placement?: number | null
          race_id?: string | null
          time_seconds: number
          user_id: string
          username: string
          wpm: number
        }
        Update: {
          accuracy?: number
          challenge_text?: string
          created_at?: string | null
          id?: string
          is_practice?: boolean | null
          placement?: number | null
          race_id?: string | null
          time_seconds?: number
          user_id?: string
          username?: string
          wpm?: number
        }
        Relationships: [
          {
            foreignKeyName: "type_racer_games_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      usage_analytics: {
        Row: {
          active_friends: number | null
          created_at: string | null
          date: string
          games_played: number | null
          id: string
          messages_received: number | null
          messages_sent: number | null
          storage_used_mb: number | null
          user_id: string
          video_minutes: number | null
          voice_minutes: number | null
        }
        Insert: {
          active_friends?: number | null
          created_at?: string | null
          date: string
          games_played?: number | null
          id?: string
          messages_received?: number | null
          messages_sent?: number | null
          storage_used_mb?: number | null
          user_id: string
          video_minutes?: number | null
          voice_minutes?: number | null
        }
        Update: {
          active_friends?: number | null
          created_at?: string | null
          date?: string
          games_played?: number | null
          id?: string
          messages_received?: number | null
          messages_sent?: number | null
          storage_used_mb?: number | null
          user_id?: string
          video_minutes?: number | null
          voice_minutes?: number | null
        }
        Relationships: [
          {
            foreignKeyName: "usage_analytics_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      user: {
        Row: {
          bio: string | null
          created_at: number
          date_of_birth: string | null
          email: string
          gender: string | null
          id: string
          info: Json | null
          last_active_at: number
          name: string
          oauth: Json | null
          presence_state: string | null
          profile_banner_image_url: string | null
          profile_image_url: string
          role: string
          scim: Json | null
          settings: Json | null
          status_emoji: string | null
          status_expires_at: number | null
          status_message: string | null
          timezone: string | null
          updated_at: number
          username: string | null
        }
        Insert: {
          bio?: string | null
          created_at: number
          date_of_birth?: string | null
          email: string
          gender?: string | null
          id: string
          info?: Json | null
          last_active_at: number
          name: string
          oauth?: Json | null
          presence_state?: string | null
          profile_banner_image_url?: string | null
          profile_image_url: string
          role: string
          scim?: Json | null
          settings?: Json | null
          status_emoji?: string | null
          status_expires_at?: number | null
          status_message?: string | null
          timezone?: string | null
          updated_at: number
          username?: string | null
        }
        Update: {
          bio?: string | null
          created_at?: number
          date_of_birth?: string | null
          email?: string
          gender?: string | null
          id?: string
          info?: Json | null
          last_active_at?: number
          name?: string
          oauth?: Json | null
          presence_state?: string | null
          profile_banner_image_url?: string | null
          profile_image_url?: string
          role?: string
          scim?: Json | null
          settings?: Json | null
          status_emoji?: string | null
          status_expires_at?: number | null
          status_message?: string | null
          timezone?: string | null
          updated_at?: number
          username?: string | null
        }
        Relationships: []
      }
      user_achievements: {
        Row: {
          achievement_id: string | null
          earned_at: string | null
          id: string
          user_id: string | null
        }
        Insert: {
          achievement_id?: string | null
          earned_at?: string | null
          id?: string
          user_id?: string | null
        }
        Update: {
          achievement_id?: string | null
          earned_at?: string | null
          id?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_achievements_achievement_id_fkey"
            columns: ["achievement_id"]
            isOneToOne: false
            referencedRelation: "achievements"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_achievements_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_activities: {
        Row: {
          activity_type: string | null
          created_at: string | null
          id: string
          message: string | null
          metadata: Json | null
          user_id: string | null
        }
        Insert: {
          activity_type?: string | null
          created_at?: string | null
          id?: string
          message?: string | null
          metadata?: Json | null
          user_id?: string | null
        }
        Update: {
          activity_type?: string | null
          created_at?: string | null
          id?: string
          message?: string | null
          metadata?: Json | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_activities_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_activity_log: {
        Row: {
          activity_type: string
          created_at: string | null
          description: string
          id: string
          metadata: Json | null
          user_id: string
        }
        Insert: {
          activity_type: string
          created_at?: string | null
          description: string
          id?: string
          metadata?: Json | null
          user_id: string
        }
        Update: {
          activity_type?: string
          created_at?: string | null
          description?: string
          id?: string
          metadata?: Json | null
          user_id?: string
        }
        Relationships: []
      }
      user_aethex_badges: {
        Row: {
          badge_id: string
          id: string
          unlocked_at: string
          user_id: string
        }
        Insert: {
          badge_id: string
          id?: string
          unlocked_at?: string
          user_id: string
        }
        Update: {
          badge_id?: string
          id?: string
          unlocked_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_aethex_badges_badge_id_fkey"
            columns: ["badge_id"]
            isOneToOne: false
            referencedRelation: "aethex_badges"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_aethex_badges_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_analytics: {
        Row: {
          achievements_unlocked: number | null
          code_snippets_shared: number | null
          created_at: string | null
          daily_active_minutes: number | null
          id: string
          last_active: string | null
          marketplace_purchases: number | null
          messages_sent: number | null
          projects_completed: number | null
          total_xp: number | null
          updated_at: string | null
          user_id: string
        }
        Insert: {
          achievements_unlocked?: number | null
          code_snippets_shared?: number | null
          created_at?: string | null
          daily_active_minutes?: number | null
          id: string
          last_active?: string | null
          marketplace_purchases?: number | null
          messages_sent?: number | null
          projects_completed?: number | null
          total_xp?: number | null
          updated_at?: string | null
          user_id: string
        }
        Update: {
          achievements_unlocked?: number | null
          code_snippets_shared?: number | null
          created_at?: string | null
          daily_active_minutes?: number | null
          id?: string
          last_active?: string | null
          marketplace_purchases?: number | null
          messages_sent?: number | null
          projects_completed?: number | null
          total_xp?: number | null
          updated_at?: string | null
          user_id?: string
        }
        Relationships: []
      }
      user_arm_affiliations: {
        Row: {
          affiliation_data: Json | null
          affiliation_type: string
          arm: string
          confirmed: boolean | null
          created_at: string | null
          id: string
          user_id: string
        }
        Insert: {
          affiliation_data?: Json | null
          affiliation_type: string
          arm: string
          confirmed?: boolean | null
          created_at?: string | null
          id?: string
          user_id: string
        }
        Update: {
          affiliation_data?: Json | null
          affiliation_type?: string
          arm?: string
          confirmed?: boolean | null
          created_at?: string | null
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_arm_affiliations_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_badges: {
        Row: {
          badge_id: string
          earned_at: string | null
          id: string
          user_id: string
        }
        Insert: {
          badge_id: string
          earned_at?: string | null
          id?: string
          user_id: string
        }
        Update: {
          badge_id?: string
          earned_at?: string | null
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_badges_badge_id_fkey"
            columns: ["badge_id"]
            isOneToOne: false
            referencedRelation: "badges"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_badges_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_bookings: {
        Row: {
          booking_title: string
          booking_type: string
          created_at: string | null
          id: string
          meeting_link: string | null
          notes: string | null
          scheduled_at: string
          status: string | null
          updated_at: string | null
          user_id: string
        }
        Insert: {
          booking_title: string
          booking_type: string
          created_at?: string | null
          id?: string
          meeting_link?: string | null
          notes?: string | null
          scheduled_at: string
          status?: string | null
          updated_at?: string | null
          user_id: string
        }
        Update: {
          booking_title?: string
          booking_type?: string
          created_at?: string | null
          id?: string
          meeting_link?: string | null
          notes?: string | null
          scheduled_at?: string
          status?: string | null
          updated_at?: string | null
          user_id?: string
        }
        Relationships: []
      }
      user_connections: {
        Row: {
          connection_id: string
          created_at: string
          user_id: string
        }
        Insert: {
          connection_id: string
          created_at?: string
          user_id: string
        }
        Update: {
          connection_id?: string
          created_at?: string
          user_id?: string
        }
        Relationships: []
      }
      user_downloads: {
        Row: {
          downloaded_at: string | null
          id: string
          user_id: string
          whitepaper_id: string | null
        }
        Insert: {
          downloaded_at?: string | null
          id?: string
          user_id: string
          whitepaper_id?: string | null
        }
        Update: {
          downloaded_at?: string | null
          id?: string
          user_id?: string
          whitepaper_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_downloads_whitepaper_id_fkey"
            columns: ["whitepaper_id"]
            isOneToOne: false
            referencedRelation: "corporate_whitepapers"
            referencedColumns: ["id"]
          },
        ]
      }
      user_email_links: {
        Row: {
          created_at: string | null
          email: string
          id: string
          is_primary: boolean | null
          linked_at: string | null
          updated_at: string | null
          user_id: string
          verified_at: string | null
        }
        Insert: {
          created_at?: string | null
          email: string
          id?: string
          is_primary?: boolean | null
          linked_at?: string | null
          updated_at?: string | null
          user_id: string
          verified_at?: string | null
        }
        Update: {
          created_at?: string | null
          email?: string
          id?: string
          is_primary?: boolean | null
          linked_at?: string | null
          updated_at?: string | null
          user_id?: string
          verified_at?: string | null
        }
        Relationships: []
      }
      user_experience_link: {
        Row: {
          asset_id: string
          asset_type: string
          created_at: string | null
          experience_id: string
          id: string
        }
        Insert: {
          asset_id: string
          asset_type: string
          created_at?: string | null
          experience_id: string
          id?: string
        }
        Update: {
          asset_id?: string
          asset_type?: string
          created_at?: string | null
          experience_id?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "experience_assets_asset_id_fkey"
            columns: ["asset_id"]
            isOneToOne: false
            referencedRelation: "assets"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "experience_assets_experience_id_fkey"
            columns: ["experience_id"]
            isOneToOne: false
            referencedRelation: "experiences"
            referencedColumns: ["id"]
          },
        ]
      }
      user_favorites: {
        Row: {
          asset_id: number | null
          collection_id: number | null
          created_at: string | null
          id: number
          listing_id: number | null
          user_id: string
        }
        Insert: {
          asset_id?: number | null
          collection_id?: number | null
          created_at?: string | null
          id?: number
          listing_id?: number | null
          user_id: string
        }
        Update: {
          asset_id?: number | null
          collection_id?: number | null
          created_at?: string | null
          id?: number
          listing_id?: number | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_favorites_asset_id_fkey"
            columns: ["asset_id"]
            isOneToOne: false
            referencedRelation: "nft_assets"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_favorites_collection_id_fkey"
            columns: ["collection_id"]
            isOneToOne: false
            referencedRelation: "nft_collections"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_favorites_listing_id_fkey"
            columns: ["listing_id"]
            isOneToOne: false
            referencedRelation: "marketplace_listings"
            referencedColumns: ["id"]
          },
        ]
      }
      user_followed_arms: {
        Row: {
          arm_id: string
          followed_at: string
          id: string
          user_id: string
        }
        Insert: {
          arm_id: string
          followed_at?: string
          id?: string
          user_id: string
        }
        Update: {
          arm_id?: string
          followed_at?: string
          id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_followed_arms_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_follows: {
        Row: {
          created_at: string
          follower_id: string
          following_id: string
          id: string
        }
        Insert: {
          created_at?: string
          follower_id: string
          following_id: string
          id?: string
        }
        Update: {
          created_at?: string
          follower_id?: string
          following_id?: string
          id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_follows_follower_id_fkey"
            columns: ["follower_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_follows_following_id_fkey"
            columns: ["following_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_interests: {
        Row: {
          created_at: string | null
          id: string
          interest: string
          user_id: string | null
        }
        Insert: {
          created_at?: string | null
          id?: string
          interest: string
          user_id?: string | null
        }
        Update: {
          created_at?: string | null
          id?: string
          interest?: string
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_interests_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_linked_accounts: {
        Row: {
          access_token: string | null
          id: string
          linked_at: string | null
          metadata: Json | null
          provider: string
          provider_avatar: string | null
          provider_email: string | null
          provider_user_id: string
          provider_username: string | null
          refresh_token: string | null
          scopes: string[] | null
          token_expires_at: string | null
          updated_at: string | null
          user_id: string
        }
        Insert: {
          access_token?: string | null
          id?: string
          linked_at?: string | null
          metadata?: Json | null
          provider: string
          provider_avatar?: string | null
          provider_email?: string | null
          provider_user_id: string
          provider_username?: string | null
          refresh_token?: string | null
          scopes?: string[] | null
          token_expires_at?: string | null
          updated_at?: string | null
          user_id: string
        }
        Update: {
          access_token?: string | null
          id?: string
          linked_at?: string | null
          metadata?: Json | null
          provider?: string
          provider_avatar?: string | null
          provider_email?: string | null
          provider_user_id?: string
          provider_username?: string | null
          refresh_token?: string | null
          scopes?: string[] | null
          token_expires_at?: string | null
          updated_at?: string | null
          user_id?: string
        }
        Relationships: []
      }
      user_mission_progress: {
        Row: {
          completed: boolean
          completed_at: string | null
          created_at: string
          id: string
          mission_id: string
          progress_count: number
          user_id: string
        }
        Insert: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          id?: string
          mission_id: string
          progress_count?: number
          user_id: string
        }
        Update: {
          completed?: boolean
          completed_at?: string | null
          created_at?: string
          id?: string
          mission_id?: string
          progress_count?: number
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_mission_progress_mission_id_fkey"
            columns: ["mission_id"]
            isOneToOne: false
            referencedRelation: "daily_missions"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_mission_progress_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_mrpiglr_site_badges: {
        Row: {
          badge_id: string
          id: string
          unlocked_at: string
          user_id: string
        }
        Insert: {
          badge_id: string
          id?: string
          unlocked_at?: string
          user_id: string
        }
        Update: {
          badge_id?: string
          id?: string
          unlocked_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_mrpiglr_site_badges_badge_id_fkey"
            columns: ["badge_id"]
            isOneToOne: false
            referencedRelation: "mrpiglr_site_badges"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_mrpiglr_site_badges_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_notifications: {
        Row: {
          action_url: string | null
          created_at: string | null
          id: string
          message: string
          read: boolean | null
          title: string
          type: string | null
          user_id: string
        }
        Insert: {
          action_url?: string | null
          created_at?: string | null
          id?: string
          message: string
          read?: boolean | null
          title: string
          type?: string | null
          user_id: string
        }
        Update: {
          action_url?: string | null
          created_at?: string | null
          id?: string
          message?: string
          read?: boolean | null
          title?: string
          type?: string | null
          user_id?: string
        }
        Relationships: []
      }
      user_professional_profiles: {
        Row: {
          bio: string | null
          certifications: Json | null
          created_at: string | null
          education: Json | null
          experience: Json | null
          github: string | null
          headline: string | null
          id: string
          linkedin: string | null
          location: string | null
          resume_url: string | null
          skills: string[] | null
          twitter: string | null
          updated_at: string | null
          user_id: string
          website: string | null
        }
        Insert: {
          bio?: string | null
          certifications?: Json | null
          created_at?: string | null
          education?: Json | null
          experience?: Json | null
          github?: string | null
          headline?: string | null
          id?: string
          linkedin?: string | null
          location?: string | null
          resume_url?: string | null
          skills?: string[] | null
          twitter?: string | null
          updated_at?: string | null
          user_id: string
          website?: string | null
        }
        Update: {
          bio?: string | null
          certifications?: Json | null
          created_at?: string | null
          education?: Json | null
          experience?: Json | null
          github?: string | null
          headline?: string | null
          id?: string
          linkedin?: string | null
          location?: string | null
          resume_url?: string | null
          skills?: string[] | null
          twitter?: string | null
          updated_at?: string | null
          user_id?: string
          website?: string | null
        }
        Relationships: []
      }
      user_profiles: {
        Row: {
          aethex_domain: string | null
          arm_affiliations: Json | null
          arms: string[] | null
          availability_status: string | null
          avatar_url: string | null
          badges: Json | null
          bio: string | null
          bio_detailed: string | null
          cache_valid_until: string | null
          created_at: string | null
          current_streak: number | null
          daily_streak: number | null
          discord_id: string | null
          discord_username: string | null
          experience_level:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          foundation_synced_at: string | null
          full_name: string | null
          github_url: string | null
          godot_player_id: string | null
          hourly_rate: number | null
          id: string
          is_architect: boolean | null
          languages: Json | null
          last_active_at: string | null
          last_daily: string | null
          last_streak_at: string | null
          last_xp_message: string | null
          level: number | null
          linkedin_url: string | null
          location: string | null
          longest_streak: number | null
          loyalty_points: number | null
          merged_to_user_id: string | null
          nexus_categories: Json | null
          nexus_headline: string | null
          nexus_profile_complete: boolean | null
          onboarded: boolean | null
          portfolio_items: Json | null
          portfolio_url: string | null
          reputation_score: number | null
          roblox_user_id: string | null
          roblox_username: string | null
          roles: string[] | null
          show_in_creator_directory: boolean
          skills_detailed: Json | null
          streak_days: number | null
          stripe_customer_id: string | null
          stripe_subscription_id: string | null
          tier: Database["public"]["Enums"]["subscription_tier_enum"] | null
          timezone: string | null
          total_xp: number | null
          twitch_url: string | null
          twitter_url: string | null
          unity_player_id: string | null
          unreal_player_id: string | null
          updated_at: string | null
          user_type: Database["public"]["Enums"]["user_type_enum"]
          username: string | null
          verified_badges: Json | null
          wallet_address: string | null
          website_url: string | null
          work_experience: Json | null
          xp: number | null
          youtube_url: string | null
        }
        Insert: {
          aethex_domain?: string | null
          arm_affiliations?: Json | null
          arms?: string[] | null
          availability_status?: string | null
          avatar_url?: string | null
          badges?: Json | null
          bio?: string | null
          bio_detailed?: string | null
          cache_valid_until?: string | null
          created_at?: string | null
          current_streak?: number | null
          daily_streak?: number | null
          discord_id?: string | null
          discord_username?: string | null
          experience_level?:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          foundation_synced_at?: string | null
          full_name?: string | null
          github_url?: string | null
          godot_player_id?: string | null
          hourly_rate?: number | null
          id: string
          is_architect?: boolean | null
          languages?: Json | null
          last_active_at?: string | null
          last_daily?: string | null
          last_streak_at?: string | null
          last_xp_message?: string | null
          level?: number | null
          linkedin_url?: string | null
          location?: string | null
          longest_streak?: number | null
          loyalty_points?: number | null
          merged_to_user_id?: string | null
          nexus_categories?: Json | null
          nexus_headline?: string | null
          nexus_profile_complete?: boolean | null
          onboarded?: boolean | null
          portfolio_items?: Json | null
          portfolio_url?: string | null
          reputation_score?: number | null
          roblox_user_id?: string | null
          roblox_username?: string | null
          roles?: string[] | null
          show_in_creator_directory?: boolean
          skills_detailed?: Json | null
          streak_days?: number | null
          stripe_customer_id?: string | null
          stripe_subscription_id?: string | null
          tier?: Database["public"]["Enums"]["subscription_tier_enum"] | null
          timezone?: string | null
          total_xp?: number | null
          twitch_url?: string | null
          twitter_url?: string | null
          unity_player_id?: string | null
          unreal_player_id?: string | null
          updated_at?: string | null
          user_type: Database["public"]["Enums"]["user_type_enum"]
          username?: string | null
          verified_badges?: Json | null
          wallet_address?: string | null
          website_url?: string | null
          work_experience?: Json | null
          xp?: number | null
          youtube_url?: string | null
        }
        Update: {
          aethex_domain?: string | null
          arm_affiliations?: Json | null
          arms?: string[] | null
          availability_status?: string | null
          avatar_url?: string | null
          badges?: Json | null
          bio?: string | null
          bio_detailed?: string | null
          cache_valid_until?: string | null
          created_at?: string | null
          current_streak?: number | null
          daily_streak?: number | null
          discord_id?: string | null
          discord_username?: string | null
          experience_level?:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          foundation_synced_at?: string | null
          full_name?: string | null
          github_url?: string | null
          godot_player_id?: string | null
          hourly_rate?: number | null
          id?: string
          is_architect?: boolean | null
          languages?: Json | null
          last_active_at?: string | null
          last_daily?: string | null
          last_streak_at?: string | null
          last_xp_message?: string | null
          level?: number | null
          linkedin_url?: string | null
          location?: string | null
          longest_streak?: number | null
          loyalty_points?: number | null
          merged_to_user_id?: string | null
          nexus_categories?: Json | null
          nexus_headline?: string | null
          nexus_profile_complete?: boolean | null
          onboarded?: boolean | null
          portfolio_items?: Json | null
          portfolio_url?: string | null
          reputation_score?: number | null
          roblox_user_id?: string | null
          roblox_username?: string | null
          roles?: string[] | null
          show_in_creator_directory?: boolean
          skills_detailed?: Json | null
          streak_days?: number | null
          stripe_customer_id?: string | null
          stripe_subscription_id?: string | null
          tier?: Database["public"]["Enums"]["subscription_tier_enum"] | null
          timezone?: string | null
          total_xp?: number | null
          twitch_url?: string | null
          twitter_url?: string | null
          unity_player_id?: string | null
          unreal_player_id?: string | null
          updated_at?: string | null
          user_type?: Database["public"]["Enums"]["user_type_enum"]
          username?: string | null
          verified_badges?: Json | null
          wallet_address?: string | null
          website_url?: string | null
          work_experience?: Json | null
          xp?: number | null
          youtube_url?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_profiles_merged_to_user_id_fkey"
            columns: ["merged_to_user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_referrals: {
        Row: {
          completed_at: string | null
          created_at: string | null
          id: string
          referral_code: string
          referred_email: string | null
          referred_user_id: string | null
          referrer_id: string
          reward_claimed: boolean | null
          status: string | null
        }
        Insert: {
          completed_at?: string | null
          created_at?: string | null
          id?: string
          referral_code: string
          referred_email?: string | null
          referred_user_id?: string | null
          referrer_id: string
          reward_claimed?: boolean | null
          status?: string | null
        }
        Update: {
          completed_at?: string | null
          created_at?: string | null
          id?: string
          referral_code?: string
          referred_email?: string | null
          referred_user_id?: string | null
          referrer_id?: string
          reward_claimed?: boolean | null
          status?: string | null
        }
        Relationships: []
      }
      user_rewards: {
        Row: {
          claimed_at: string
          id: string
          reward_id: string
          user_id: string
        }
        Insert: {
          claimed_at?: string
          id?: string
          reward_id: string
          user_id: string
        }
        Update: {
          claimed_at?: string
          id?: string
          reward_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_rewards_reward_id_fkey"
            columns: ["reward_id"]
            isOneToOne: false
            referencedRelation: "rewards"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_rewards_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_roles: {
        Row: {
          role_id: string
          user_id: string
        }
        Insert: {
          role_id: string
          user_id: string
        }
        Update: {
          role_id?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_roles_role_id_fkey"
            columns: ["role_id"]
            isOneToOne: false
            referencedRelation: "roles"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_roles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_saved_jobs: {
        Row: {
          company: string | null
          created_at: string | null
          id: string
          job_id: string
          job_title: string
          job_url: string | null
          location: string | null
          user_id: string
        }
        Insert: {
          company?: string | null
          created_at?: string | null
          id?: string
          job_id: string
          job_title: string
          job_url?: string | null
          location?: string | null
          user_id: string
        }
        Update: {
          company?: string | null
          created_at?: string | null
          id?: string
          job_id?: string
          job_title?: string
          job_url?: string | null
          location?: string | null
          user_id?: string
        }
        Relationships: []
      }
      user_sessions: {
        Row: {
          created_at: string | null
          device_name: string | null
          device_type: string | null
          expires_at: string
          id: string
          ip_address: string | null
          last_active_at: string | null
          token: string
          user_agent: string | null
          user_id: string
        }
        Insert: {
          created_at?: string | null
          device_name?: string | null
          device_type?: string | null
          expires_at: string
          id?: string
          ip_address?: string | null
          last_active_at?: string | null
          token: string
          user_agent?: string | null
          user_id: string
        }
        Update: {
          created_at?: string | null
          device_name?: string | null
          device_type?: string | null
          expires_at?: string
          id?: string
          ip_address?: string | null
          last_active_at?: string | null
          token?: string
          user_agent?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_sessions_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "users"
            referencedColumns: ["id"]
          },
        ]
      }
      user_stats: {
        Row: {
          commands_used: number | null
          created_at: string | null
          guild_id: string
          id: number
          messages_sent: number | null
          reactions_given: number | null
          reactions_received: number | null
          updated_at: string | null
          user_id: string | null
          voice_minutes: number | null
        }
        Insert: {
          commands_used?: number | null
          created_at?: string | null
          guild_id: string
          id?: number
          messages_sent?: number | null
          reactions_given?: number | null
          reactions_received?: number | null
          updated_at?: string | null
          user_id?: string | null
          voice_minutes?: number | null
        }
        Update: {
          commands_used?: number | null
          created_at?: string | null
          guild_id?: string
          id?: number
          messages_sent?: number | null
          reactions_given?: number | null
          reactions_received?: number | null
          updated_at?: string | null
          user_id?: string | null
          voice_minutes?: number | null
        }
        Relationships: []
      }
      user_streaks: {
        Row: {
          created_at: string
          current_streak: number
          id: string
          last_activity_date: string | null
          longest_streak: number
          streak_multiplier: number
          total_streak_days: number
          updated_at: string
          user_id: string
        }
        Insert: {
          created_at?: string
          current_streak?: number
          id?: string
          last_activity_date?: string | null
          longest_streak?: number
          streak_multiplier?: number
          total_streak_days?: number
          updated_at?: string
          user_id: string
        }
        Update: {
          created_at?: string
          current_streak?: number
          id?: string
          last_activity_date?: string | null
          longest_streak?: number
          streak_multiplier?: number
          total_streak_days?: number
          updated_at?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "user_streaks_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: true
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_titles: {
        Row: {
          id: string
          title_id: string | null
          unlocked_at: string | null
          user_id: string | null
        }
        Insert: {
          id?: string
          title_id?: string | null
          unlocked_at?: string | null
          user_id?: string | null
        }
        Update: {
          id?: string
          title_id?: string | null
          unlocked_at?: string | null
          user_id?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "user_titles_title_id_fkey"
            columns: ["title_id"]
            isOneToOne: false
            referencedRelation: "rewards"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "user_titles_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      user_wallets: {
        Row: {
          chain_id: number
          chain_name: string | null
          created_at: string | null
          id: number
          is_primary: boolean | null
          updated_at: string | null
          user_id: string
          verified_at: string | null
          wallet_address: string
        }
        Insert: {
          chain_id: number
          chain_name?: string | null
          created_at?: string | null
          id?: number
          is_primary?: boolean | null
          updated_at?: string | null
          user_id: string
          verified_at?: string | null
          wallet_address: string
        }
        Update: {
          chain_id?: number
          chain_name?: string | null
          created_at?: string | null
          id?: number
          is_primary?: boolean | null
          updated_at?: string | null
          user_id?: string
          verified_at?: string | null
          wallet_address?: string
        }
        Relationships: []
      }
      users: {
        Row: {
          avatar_url: string | null
          bio: string | null
          created_at: string
          display_name: string | null
          domain_verified_at: string | null
          id: string
          is_active: boolean
          is_admin: boolean
          level: number | null
          password: string
          premium_tier: string | null
          status: string | null
          username: string
          verified_domain: string | null
          xp: number | null
        }
        Insert: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          display_name?: string | null
          domain_verified_at?: string | null
          id?: string
          is_active?: boolean
          is_admin?: boolean
          level?: number | null
          password: string
          premium_tier?: string | null
          status?: string | null
          username: string
          verified_domain?: string | null
          xp?: number | null
        }
        Update: {
          avatar_url?: string | null
          bio?: string | null
          created_at?: string
          display_name?: string | null
          domain_verified_at?: string | null
          id?: string
          is_active?: boolean
          is_admin?: boolean
          level?: number | null
          password?: string
          premium_tier?: string | null
          status?: string | null
          username?: string
          verified_domain?: string | null
          xp?: number | null
        }
        Relationships: []
      }
      voice_states: {
        Row: {
          channel_id: string
          discord_user_id: string
          discord_username: string
          guild_id: string
          joined_at: string | null
          last_updated: string | null
        }
        Insert: {
          channel_id: string
          discord_user_id: string
          discord_username: string
          guild_id: string
          joined_at?: string | null
          last_updated?: string | null
        }
        Update: {
          channel_id?: string
          discord_user_id?: string
          discord_username?: string
          guild_id?: string
          joined_at?: string | null
          last_updated?: string | null
        }
        Relationships: []
      }
      volunteer_applications: {
        Row: {
          created_at: string
          id: string
          message: string | null
          opportunity_id: string
          status: string
          user_id: string
        }
        Insert: {
          created_at?: string
          id?: string
          message?: string | null
          opportunity_id: string
          status?: string
          user_id: string
        }
        Update: {
          created_at?: string
          id?: string
          message?: string | null
          opportunity_id?: string
          status?: string
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "volunteer_applications_opportunity_id_fkey"
            columns: ["opportunity_id"]
            isOneToOne: false
            referencedRelation: "volunteer_opportunities"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "volunteer_applications_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      volunteer_opportunities: {
        Row: {
          created_at: string
          description: string
          id: string
          is_active: boolean
          responsibilities: string[] | null
          skills_required: string[] | null
          time_commitment: string | null
          title: string
        }
        Insert: {
          created_at?: string
          description: string
          id?: string
          is_active?: boolean
          responsibilities?: string[] | null
          skills_required?: string[] | null
          time_commitment?: string | null
          title: string
        }
        Update: {
          created_at?: string
          description?: string
          id?: string
          is_active?: boolean
          responsibilities?: string[] | null
          skills_required?: string[] | null
          time_commitment?: string | null
          title?: string
        }
        Relationships: []
      }
      volunteer_testimonials: {
        Row: {
          avatar_url: string | null
          created_at: string
          id: string
          name: string
          role: string
          testimonial: string
        }
        Insert: {
          avatar_url?: string | null
          created_at?: string
          id?: string
          name: string
          role: string
          testimonial: string
        }
        Update: {
          avatar_url?: string | null
          created_at?: string
          id?: string
          name?: string
          role?: string
          testimonial?: string
        }
        Relationships: []
      }
      waitlist: {
        Row: {
          created_at: string
          email: string
          id: string
          segment: string | null
          site_id: string | null
        }
        Insert: {
          created_at?: string
          email: string
          id?: string
          segment?: string | null
          site_id?: string | null
        }
        Update: {
          created_at?: string
          email?: string
          id?: string
          segment?: string | null
          site_id?: string | null
        }
        Relationships: []
      }
      warnings: {
        Row: {
          created_at: string | null
          guild_id: string
          id: number
          moderator_id: string
          moderator_tag: string | null
          reason: string | null
          user_id: string
          user_tag: string | null
        }
        Insert: {
          created_at?: string | null
          guild_id: string
          id?: number
          moderator_id: string
          moderator_tag?: string | null
          reason?: string | null
          user_id: string
          user_tag?: string | null
        }
        Update: {
          created_at?: string | null
          guild_id?: string
          id?: number
          moderator_id?: string
          moderator_tag?: string | null
          reason?: string | null
          user_id?: string
          user_tag?: string | null
        }
        Relationships: []
      }
      web3_nonces: {
        Row: {
          created_at: string | null
          expires_at: string
          id: string
          nonce: string
          used_at: string | null
          wallet_address: string
        }
        Insert: {
          created_at?: string | null
          expires_at: string
          id?: string
          nonce: string
          used_at?: string | null
          wallet_address: string
        }
        Update: {
          created_at?: string | null
          expires_at?: string
          id?: string
          nonce?: string
          used_at?: string | null
          wallet_address?: string
        }
        Relationships: []
      }
      web3_wallets: {
        Row: {
          chain_id: number | null
          id: string
          last_verified: string | null
          linked_at: string | null
          user_id: string
          wallet_address: string
        }
        Insert: {
          chain_id?: number | null
          id?: string
          last_verified?: string | null
          linked_at?: string | null
          user_id: string
          wallet_address: string
        }
        Update: {
          chain_id?: number | null
          id?: string
          last_verified?: string | null
          linked_at?: string | null
          user_id?: string
          wallet_address?: string
        }
        Relationships: [
          {
            foreignKeyName: "web3_wallets_user_id_fkey"
            columns: ["user_id"]
            isOneToOne: false
            referencedRelation: "user_profiles"
            referencedColumns: ["id"]
          },
        ]
      }
      work_sessions: {
        Row: {
          clock_in: string
          clock_out: string | null
          created_at: string | null
          duration_minutes: number | null
          id: string
          notes: string | null
          project_id: string | null
          source: string | null
          task_id: string | null
          user_id: string
        }
        Insert: {
          clock_in?: string
          clock_out?: string | null
          created_at?: string | null
          duration_minutes?: number | null
          id?: string
          notes?: string | null
          project_id?: string | null
          source?: string | null
          task_id?: string | null
          user_id: string
        }
        Update: {
          clock_in?: string
          clock_out?: string | null
          created_at?: string | null
          duration_minutes?: number | null
          id?: string
          notes?: string | null
          project_id?: string | null
          source?: string | null
          task_id?: string | null
          user_id?: string
        }
        Relationships: [
          {
            foreignKeyName: "work_sessions_project_id_fkey"
            columns: ["project_id"]
            isOneToOne: false
            referencedRelation: "gameforge_projects"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "work_sessions_task_id_fkey"
            columns: ["task_id"]
            isOneToOne: false
            referencedRelation: "gameforge_tasks"
            referencedColumns: ["id"]
          },
        ]
      }
      workspace_settings: {
        Row: {
          auto_save: boolean | null
          created_at: string | null
          email_notifications: boolean | null
          font_size: number | null
          id: string
          notifications_enabled: boolean | null
          privacy_activity_visible: boolean | null
          privacy_profile_visible: boolean | null
          show_minimap: boolean | null
          show_sidebar: boolean | null
          theme: string | null
          updated_at: string | null
          user_id: string
          word_wrap: boolean | null
        }
        Insert: {
          auto_save?: boolean | null
          created_at?: string | null
          email_notifications?: boolean | null
          font_size?: number | null
          id: string
          notifications_enabled?: boolean | null
          privacy_activity_visible?: boolean | null
          privacy_profile_visible?: boolean | null
          show_minimap?: boolean | null
          show_sidebar?: boolean | null
          theme?: string | null
          updated_at?: string | null
          user_id: string
          word_wrap?: boolean | null
        }
        Update: {
          auto_save?: boolean | null
          created_at?: string | null
          email_notifications?: boolean | null
          font_size?: number | null
          id?: string
          notifications_enabled?: boolean | null
          privacy_activity_visible?: boolean | null
          privacy_profile_visible?: boolean | null
          show_minimap?: boolean | null
          show_sidebar?: boolean | null
          theme?: string | null
          updated_at?: string | null
          user_id?: string
          word_wrap?: boolean | null
        }
        Relationships: []
      }
      xp_config: {
        Row: {
          bonus_channels: Json | null
          created_at: string | null
          difficulty: string | null
          guild_id: string
          id: number
          reaction_xp: number | null
          role_multipliers: Json | null
          voice_xp_per_minute: number | null
          xp_cooldown: number | null
          xp_per_message: number | null
        }
        Insert: {
          bonus_channels?: Json | null
          created_at?: string | null
          difficulty?: string | null
          guild_id: string
          id?: number
          reaction_xp?: number | null
          role_multipliers?: Json | null
          voice_xp_per_minute?: number | null
          xp_cooldown?: number | null
          xp_per_message?: number | null
        }
        Update: {
          bonus_channels?: Json | null
          created_at?: string | null
          difficulty?: string | null
          guild_id?: string
          id?: number
          reaction_xp?: number | null
          role_multipliers?: Json | null
          voice_xp_per_minute?: number | null
          xp_cooldown?: number | null
          xp_per_message?: number | null
        }
        Relationships: []
      }
    }
    Views: {
      crm_site_config_view: {
        Row: {
          id: string | null
          maintenance_mode: boolean | null
          site_id: string | null
          site_name: string | null
          system_status: string | null
          system_status_message: string | null
          url: string | null
        }
        Relationships: []
      }
      foundation_gig_radar: {
        Row: {
          applicant_count: number | null
          availability_status: string | null
          category: string | null
          compensation_type: string | null
          location_requirement: string | null
          opportunity_id: string | null
          published_at: string | null
          required_experience: string | null
          required_skills: string[] | null
          status: string | null
          timeline_type: string | null
          title: string | null
        }
        Insert: {
          applicant_count?: never
          availability_status?: never
          category?: string | null
          compensation_type?: never
          location_requirement?: string | null
          opportunity_id?: string | null
          published_at?: string | null
          required_experience?: string | null
          required_skills?: string[] | null
          status?: string | null
          timeline_type?: string | null
          title?: string | null
        }
        Update: {
          applicant_count?: never
          availability_status?: never
          category?: string | null
          compensation_type?: never
          location_requirement?: string | null
          opportunity_id?: string | null
          published_at?: string | null
          required_experience?: string | null
          required_skills?: string[] | null
          status?: string | null
          timeline_type?: string | null
          title?: string | null
        }
        Relationships: []
      }
      staff_directory: {
        Row: {
          avatar_url: string | null
          created_at: string | null
          department: string | null
          email: string | null
          full_name: string | null
          id: string | null
          is_active: boolean | null
          phone: string | null
          position: string | null
          role: string | null
          type: string | null
          user_id: string | null
        }
        Relationships: []
      }
    }
    Functions: {
      add_loyalty_points: {
        Args: { points_to_add: number; target_user_id: string }
        Returns: undefined
      }
      admin_change_user_role: {
        Args: { p_new_role: string; p_target_user_id: string }
        Returns: undefined
      }
      admin_delete_user: {
        Args: { p_target_user_id: string }
        Returns: undefined
      }
      admin_suspend_user: {
        Args: { p_reason: string; p_target_user_id: string }
        Returns: undefined
      }
      admin_unsuspend_user: {
        Args: { p_target_user_id: string }
        Returns: undefined
      }
      assign_dev_hub_uuid: { Args: never; Returns: undefined }
      calculate_az_eligible_hours: {
        Args: { p_end_date: string; p_start_date: string; p_talent_id: string }
        Returns: number
      }
      check_user_permission: {
        Args: { p_permission_name: string; p_user_id: string }
        Returns: boolean
      }
      claim_reward: { Args: { reward_id_to_claim: string }; Returns: string }
      cleanup_expired_nonces: { Args: never; Returns: undefined }
      cleanup_expired_oauth_codes: { Args: never; Returns: undefined }
      cleanup_expired_pending_links: { Args: never; Returns: undefined }
      cleanup_expired_refresh_tokens: { Args: never; Returns: undefined }
      cleanup_expired_turn_credentials: { Args: never; Returns: number }
      cleanup_old_api_logs: { Args: never; Returns: undefined }
      create_api_key: { Args: { p_name: string }; Returns: Json }
      create_site: { Args: { new_site_name: string }; Returns: Json }
      ensure_site_context: {
        Args: { p_user_email: string; p_user_id: string }
        Returns: undefined
      }
      ensure_user_is_overseeer: {
        Args: { p_user_email: string }
        Returns: undefined
      }
      generate_and_resolve_alerts: {
        Args: { p_metrics: Json; p_site_id: string; p_status: string }
        Returns: undefined
      }
      generate_site_url: { Args: { p_site_name: string }; Returns: string }
      get_all_users_for_site: {
        Args: { p_site_id: string }
        Returns: {
          avatar_url: string
          email: string
          full_name: string
          id: string
          role: string
          status: string
          suspended_at: string
          suspension_reason: string
          username: string
        }[]
      }
      get_api_key_stats: {
        Args: { key_id: string }
        Returns: {
          avg_response_time_ms: number
          error_rate: number
          requests_this_week: number
          requests_today: number
          total_requests: number
        }[]
      }
      get_crm_dashboard_stats: { Args: never; Returns: Json }
      get_employee_management_stats: {
        Args: { p_site_id: string }
        Returns: Json
      }
      get_forum_stats: {
        Args: never
        Returns: {
          category_description: string
          category_id: string
          category_name: string
          category_slug: string
          latest_posts: Json
          total_comments_count: number
          total_posts_count: number
        }[]
      }
      get_nft_ownership_history: {
        Args: {
          p_chain_id: number
          p_contract_address: string
          p_token_id: string
        }
        Returns: {
          event_timestamp: string
          from_address: string
          price: number
          price_currency: string
          to_address: string
          transaction_hash: string
        }[]
      }
      get_or_create_direct_conversation: {
        Args: { user1_id: string; user2_id: string }
        Returns: string
      }
      get_or_create_personal_site_config: {
        Args: { p_site_uuid: string }
        Returns: {
          created_at: string
          id: string
          site_id: string
          site_status: string
          updated_at: string
        }
        SetofOptions: {
          from: "*"
          to: "personal_site_config"
          isOneToOne: true
          isSetofReturn: false
        }
      }
      get_or_create_site_by_uuid: {
        Args: { p_owner_id: string; p_site_name: string; p_site_uuid: string }
        Returns: Json
      }
      get_or_create_site_config: {
        Args: { p_site_name: string }
        Returns: {
          created_at: string
          favicon_url: string | null
          id: string
          logo_url: string | null
          maintenance_ends_at: string | null
          maintenance_mode: boolean | null
          primary_color: string | null
          secondary_color: string | null
          site_description: string | null
          site_id: string
          site_name: string | null
          status_updates: Json | null
          system_status: string
          system_status_message: string | null
          updated_at: string
        }[]
        SetofOptions: {
          from: "*"
          to: "site_config"
          isOneToOne: false
          isSetofReturn: true
        }
      }
      get_or_create_site_config_by_admin: {
        Args: never
        Returns: {
          created_at: string
          favicon_url: string | null
          id: string
          logo_url: string | null
          maintenance_ends_at: string | null
          maintenance_mode: boolean | null
          primary_color: string | null
          secondary_color: string | null
          site_description: string | null
          site_id: string
          site_name: string | null
          status_updates: Json | null
          system_status: string
          system_status_message: string | null
          updated_at: string
        }[]
        SetofOptions: {
          from: "*"
          to: "site_config"
          isOneToOne: false
          isSetofReturn: true
        }
      }
      get_or_create_site_config_by_uuid:
        | { Args: { p_site_name: string; p_site_uuid: string }; Returns: Json }
        | {
            Args: {
              p_owner_id: string
              p_site_name: string
              p_site_uuid: string
            }
            Returns: Json
          }
      get_project_stats: { Args: { p_project_id: string }; Returns: Json }
      get_site_owner_id: { Args: { p_site_id: string }; Returns: string }
      get_site_role: { Args: { p_site_id: string }; Returns: string }
      get_staff_role: { Args: { user_id: string }; Returns: string }
      get_system_overview_stats: { Args: never; Returns: Json }
      get_table_stats: {
        Args: never
        Returns: {
          name: string
          rows: number
          size: string
        }[]
      }
      get_talent_compliance_summary: {
        Args: { p_user_id: string }
        Returns: Json
      }
      get_todays_missions: {
        Args: never
        Returns: {
          created_at: string
          description: string | null
          id: string
          is_active: boolean
          mission_date: string
          mission_type: string
          title: string
          xp_reward: number
        }[]
        SetofOptions: {
          from: "*"
          to: "daily_missions"
          isOneToOne: false
          isSetofReturn: true
        }
      }
      get_user_dashboard_stats:
        | { Args: { p_user_id: string }; Returns: Json }
        | { Args: { p_site_id: string; p_user_id: string }; Returns: Json }
      get_user_portfolio_value: { Args: { p_user_id: string }; Returns: number }
      get_user_profile_stats: { Args: { p_user_id: string }; Returns: Json }
      get_user_profiles_by_ids: {
        Args: { user_ids: string[] }
        Returns: {
          active_title: string | null
          aethex_passport_id: string
          avatar_url: string | null
          banner_url: string | null
          bio: string | null
          created_at: string
          discord_user_id: string | null
          discord_username: string | null
          education: Json | null
          email: string | null
          experience: Json | null
          experience_level:
            | Database["public"]["Enums"]["experience_level_enum"]
            | null
          featured_badge_ids: string[] | null
          full_name: string | null
          github_url: string | null
          id: string
          is_verified: boolean | null
          level: number | null
          linkedin_url: string | null
          location: string | null
          loyalty_points: number
          onboarded: boolean
          primary_role: string | null
          roblox_access_token: string | null
          roblox_refresh_token: string | null
          roblox_token_expires_at: string | null
          roblox_user_id: number | null
          role: string
          signature: string | null
          skills: string[] | null
          social_links: Json | null
          specialization: Json | null
          status: string | null
          suspended_at: string | null
          suspension_reason: string | null
          telemetry_api_key: string | null
          total_xp: number | null
          twitter_url: string | null
          updated_at: string
          user_type: Database["public"]["Enums"]["user_type_enum"] | null
          username: string
          website_url: string | null
        }[]
        SetofOptions: {
          from: "*"
          to: "profiles"
          isOneToOne: false
          isSetofReturn: true
        }
      }
      get_user_sites: {
        Args: { p_user_id: string }
        Returns: {
          role: string
          site_id: string
          site_name: string
        }[]
      }
      get_users_not_in_project: {
        Args: { p_project_id: string }
        Returns: {
          id: string
          role: string
          username: string
        }[]
      }
      grant_reward: {
        Args: { reward_to_grant_id: string; target_user_id: string }
        Returns: undefined
      }
      increment_post_view: { Args: { p_post_id: string }; Returns: undefined }
      initialize_site_and_get_identity: {
        Args: { p_owner_id: string; p_site_name: string }
        Returns: string
      }
      is_mrpiglr_admin: { Args: never; Returns: boolean }
      is_staff_admin: { Args: { user_id: string }; Returns: boolean }
      is_staff_member: { Args: { user_id: string }; Returns: boolean }
      populate_initial_site_data: {
        Args: { p_site_id: string }
        Returns: undefined
      }
      populate_site_changelog: {
        Args: { p_site_name: string }
        Returns: undefined
      }
      suspend_user_by_admin: {
        Args: { p_reason: string; p_site_id: string; p_target_user_id: string }
        Returns: undefined
      }
      sync_creator_dashboard: {
        Args: { p_user_id: string }
        Returns: undefined
      }
      unsuspend_user_by_admin: {
        Args: { p_site_id: string; p_target_user_id: string }
        Returns: undefined
      }
      update_aethex_site_metrics: {
        Args: {
          p_metrics: Json
          p_requests: number
          p_response_time: number
          p_services: string[]
          p_site_id: string
          p_status: string
          p_uptime: number
          p_users: number
        }
        Returns: undefined
      }
      update_collection_floor_price: {
        Args: { p_collection_id: number }
        Returns: undefined
      }
      update_user_details_by_admin: {
        Args: {
          new_full_name: string
          new_username: string
          target_user_id: string
        }
        Returns: undefined
      }
      update_user_role_by_admin:
        | {
            Args: {
              p_new_role: string
              p_site_id: string
              p_target_user_id: string
            }
            Returns: undefined
          }
        | {
            Args: { new_role: string; target_user_id: string }
            Returns: undefined
          }
      update_user_stats_for_achievement: {
        Args: {
          p_points_reward: number
          p_user_id: string
          p_xp_reward: number
        }
        Returns: undefined
      }
      update_user_streak: { Args: { p_user_id: string }; Returns: undefined }
      upsert_profile_from_roblox: {
        Args: {
          p_access_token: string
          p_expires_in: number
          p_refresh_token: string
          p_roblox_avatar_url: string
          p_roblox_user_id: number
          p_roblox_username: string
        }
        Returns: string
      }
    }
    Enums: {
      creator_type: "user" | "group"
      experience_level_enum: "beginner" | "intermediate" | "advanced" | "expert"
      pricing_plan_interval: "day" | "week" | "month" | "year"
      pricing_type: "one_time" | "recurring"
      project_status: "planning" | "active" | "paused" | "completed"
      project_status_enum: "planning" | "in_progress" | "completed" | "on_hold"
      subscription_status:
        | "trialing"
        | "active"
        | "canceled"
        | "incomplete"
        | "incomplete_expired"
        | "past_due"
        | "unpaid"
        | "paused"
      subscription_tier_enum: "free" | "pro" | "council"
      user_role:
        | "oversee"
        | "site_owner"
        | "admin"
        | "employee"
        | "client"
        | "member"
        | "guest"
      user_type: "member" | "employee" | "oversee"
      user_type_enum:
        | "game_developer"
        | "client"
        | "community_member"
        | "customer"
        | "staff"
        | "admin"
    }
    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: {
      creator_type: ["user", "group"],
      experience_level_enum: ["beginner", "intermediate", "advanced", "expert"],
      pricing_plan_interval: ["day", "week", "month", "year"],
      pricing_type: ["one_time", "recurring"],
      project_status: ["planning", "active", "paused", "completed"],
      project_status_enum: ["planning", "in_progress", "completed", "on_hold"],
      subscription_status: [
        "trialing",
        "active",
        "canceled",
        "incomplete",
        "incomplete_expired",
        "past_due",
        "unpaid",
        "paused",
      ],
      subscription_tier_enum: ["free", "pro", "council"],
      user_role: [
        "oversee",
        "site_owner",
        "admin",
        "employee",
        "client",
        "member",
        "guest",
      ],
      user_type: ["member", "employee", "oversee"],
      user_type_enum: [
        "game_developer",
        "client",
        "community_member",
        "customer",
        "staff",
        "admin",
      ],
    },
  },
} as const

