mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 03:11:13 -05:00
Fix: Approve database migration
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
-- Add check constraints to enforce metric-only units in statistics tables
|
||||
-- This ensures data integrity and compliance with the custom knowledge requirement:
|
||||
-- "Unit Conversion Rules: Storage: Always metric in DB (km/h, m, cm, kg)"
|
||||
|
||||
-- Add constraint to ride_coaster_stats table
|
||||
ALTER TABLE ride_coaster_stats
|
||||
ADD CONSTRAINT ride_coaster_stats_metric_unit_check
|
||||
CHECK (
|
||||
unit IS NULL OR
|
||||
unit IN ('km/h', 'm', 'cm', 'kg', 'g', 'G', 'celsius', 'seconds', 'minutes', 'hours', 'count', '%')
|
||||
);
|
||||
|
||||
-- Add constraint to ride_technical_specifications table
|
||||
ALTER TABLE ride_technical_specifications
|
||||
ADD CONSTRAINT ride_tech_specs_metric_unit_check
|
||||
CHECK (
|
||||
unit IS NULL OR
|
||||
unit IN ('km/h', 'm', 'cm', 'kg', 'g', 'G', 'celsius', 'seconds', 'minutes', 'hours', 'count', '%')
|
||||
);
|
||||
|
||||
-- Add constraint to ride_model_technical_specifications table
|
||||
ALTER TABLE ride_model_technical_specifications
|
||||
ADD CONSTRAINT ride_model_tech_specs_metric_unit_check
|
||||
CHECK (
|
||||
unit IS NULL OR
|
||||
unit IN ('km/h', 'm', 'cm', 'kg', 'g', 'G', 'celsius', 'seconds', 'minutes', 'hours', 'count', '%')
|
||||
);
|
||||
Reference in New Issue
Block a user