mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 09:51:13 -05:00
Update Lovable tool use
This commit is contained in:
@@ -24,6 +24,7 @@ export type Database = {
|
|||||||
id: string
|
id: string
|
||||||
logo_url: string | null
|
logo_url: string | null
|
||||||
name: string
|
name: string
|
||||||
|
person_type: string | null
|
||||||
slug: string
|
slug: string
|
||||||
updated_at: string
|
updated_at: string
|
||||||
website_url: string | null
|
website_url: string | null
|
||||||
@@ -37,6 +38,7 @@ export type Database = {
|
|||||||
id?: string
|
id?: string
|
||||||
logo_url?: string | null
|
logo_url?: string | null
|
||||||
name: string
|
name: string
|
||||||
|
person_type?: string | null
|
||||||
slug: string
|
slug: string
|
||||||
updated_at?: string
|
updated_at?: string
|
||||||
website_url?: string | null
|
website_url?: string | null
|
||||||
@@ -50,6 +52,7 @@ export type Database = {
|
|||||||
id?: string
|
id?: string
|
||||||
logo_url?: string | null
|
logo_url?: string | null
|
||||||
name?: string
|
name?: string
|
||||||
|
person_type?: string | null
|
||||||
slug?: string
|
slug?: string
|
||||||
updated_at?: string
|
updated_at?: string
|
||||||
website_url?: string | null
|
website_url?: string | null
|
||||||
@@ -490,6 +493,7 @@ export type Database = {
|
|||||||
park_id: string
|
park_id: string
|
||||||
review_count: number | null
|
review_count: number | null
|
||||||
ride_model_id: string | null
|
ride_model_id: string | null
|
||||||
|
ride_sub_type: string | null
|
||||||
slug: string
|
slug: string
|
||||||
status: string
|
status: string
|
||||||
technical_specs: Json | null
|
technical_specs: Json | null
|
||||||
@@ -519,6 +523,7 @@ export type Database = {
|
|||||||
park_id: string
|
park_id: string
|
||||||
review_count?: number | null
|
review_count?: number | null
|
||||||
ride_model_id?: string | null
|
ride_model_id?: string | null
|
||||||
|
ride_sub_type?: string | null
|
||||||
slug: string
|
slug: string
|
||||||
status?: string
|
status?: string
|
||||||
technical_specs?: Json | null
|
technical_specs?: Json | null
|
||||||
@@ -548,6 +553,7 @@ export type Database = {
|
|||||||
park_id?: string
|
park_id?: string
|
||||||
review_count?: number | null
|
review_count?: number | null
|
||||||
ride_model_id?: string | null
|
ride_model_id?: string | null
|
||||||
|
ride_sub_type?: string | null
|
||||||
slug?: string
|
slug?: string
|
||||||
status?: string
|
status?: string
|
||||||
technical_specs?: Json | null
|
technical_specs?: Json | null
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export interface Company {
|
|||||||
slug: string;
|
slug: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
company_type: string; // Allow any string from database
|
company_type: string; // Allow any string from database
|
||||||
|
person_type: string; // 'company', 'individual', 'firm', 'organization'
|
||||||
website_url?: string;
|
website_url?: string;
|
||||||
founded_year?: number;
|
founded_year?: number;
|
||||||
headquarters_location?: string;
|
headquarters_location?: string;
|
||||||
@@ -68,6 +69,7 @@ export interface Ride {
|
|||||||
manufacturer?: Company;
|
manufacturer?: Company;
|
||||||
designer?: Company;
|
designer?: Company;
|
||||||
category: string; // Allow any string from database
|
category: string; // Allow any string from database
|
||||||
|
ride_sub_type?: string; // Sub-category like "Flying Coaster", "Inverted Coaster", etc.
|
||||||
status: string; // Allow any string from database
|
status: string; // Allow any string from database
|
||||||
opening_date?: string;
|
opening_date?: string;
|
||||||
closing_date?: string;
|
closing_date?: string;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
-- Add ride_sub_type field to rides table for sub-categories like "Flying Coaster", "Inverted Coaster", etc.
|
||||||
|
-- This is separate from ride_type in ride_models to allow flexibility for rides without models
|
||||||
|
ALTER TABLE public.rides
|
||||||
|
ADD COLUMN ride_sub_type TEXT;
|
||||||
|
|
||||||
|
-- Update companies table to better handle both companies and individuals
|
||||||
|
-- Add a person_type field to distinguish between companies, individuals, and firms
|
||||||
|
ALTER TABLE public.companies
|
||||||
|
ADD COLUMN person_type TEXT DEFAULT 'company' CHECK (person_type IN ('company', 'individual', 'firm', 'organization'));
|
||||||
|
|
||||||
|
-- Add index for better performance on ride sub-type queries
|
||||||
|
CREATE INDEX idx_rides_ride_sub_type ON public.rides(ride_sub_type);
|
||||||
|
|
||||||
|
-- Add index for better performance on company person_type queries
|
||||||
|
CREATE INDEX idx_companies_person_type ON public.companies(person_type);
|
||||||
|
|
||||||
|
-- Add some example ride sub-types as comments for reference
|
||||||
|
COMMENT ON COLUMN public.rides.ride_sub_type IS 'Sub-category of ride type, e.g., "Flying Coaster", "Inverted Coaster", "Log Flume", "Shoot the Chutes"';
|
||||||
|
COMMENT ON COLUMN public.companies.person_type IS 'Type of entity: company, individual, firm, or organization';
|
||||||
|
|
||||||
|
-- Update existing companies to have proper person_type (defaulting to company)
|
||||||
|
UPDATE public.companies SET person_type = 'company' WHERE person_type IS NULL;
|
||||||
Reference in New Issue
Block a user