mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 04:51:11 -05:00
Batch update all date precision handling to use expanded DatePrecision, replace hardcoded day defaults, and adjust related validation, UI, and helpers. Includes wrapper migration across Phase 1-3 functions, updates to logs, displays, and formatting utilities to align frontend with new precision values ('exact', 'month', 'year', 'decade', 'century', 'approximate').
99 lines
2.4 KiB
SQL
99 lines
2.4 KiB
SQL
-- Phase 3: Migrate 'day' precision to 'exact' across all tables
|
|
-- This fixes the check constraint violations and aligns with the new precision system
|
|
|
|
-- Parks
|
|
UPDATE parks
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE parks
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Park Submissions
|
|
UPDATE park_submissions
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE park_submissions
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Park Versions
|
|
UPDATE park_versions
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE park_versions
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Rides
|
|
UPDATE rides
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE rides
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Ride Submissions
|
|
UPDATE ride_submissions
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE ride_submissions
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Ride Versions
|
|
UPDATE ride_versions
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE ride_versions
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Companies
|
|
UPDATE companies
|
|
SET founded_date_precision = 'exact'
|
|
WHERE founded_date_precision = 'day';
|
|
|
|
-- Company Submissions
|
|
UPDATE company_submissions
|
|
SET founded_date_precision = 'exact'
|
|
WHERE founded_date_precision = 'day';
|
|
|
|
-- Company Versions
|
|
UPDATE company_versions
|
|
SET founded_date_precision = 'exact'
|
|
WHERE founded_date_precision = 'day';
|
|
|
|
-- Entity Timeline Events
|
|
UPDATE entity_timeline_events
|
|
SET event_date_precision = 'exact'
|
|
WHERE event_date_precision = 'day';
|
|
|
|
-- Timeline Event Submissions
|
|
UPDATE timeline_event_submissions
|
|
SET event_date_precision = 'exact'
|
|
WHERE event_date_precision = 'day';
|
|
|
|
-- Historical Parks
|
|
UPDATE historical_parks
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE historical_parks
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day';
|
|
|
|
-- Historical Rides
|
|
UPDATE historical_rides
|
|
SET opening_date_precision = 'exact'
|
|
WHERE opening_date_precision = 'day';
|
|
|
|
UPDATE historical_rides
|
|
SET closing_date_precision = 'exact'
|
|
WHERE closing_date_precision = 'day'; |