Refactor Experiment components to support new experiment book structure
- Updated ExperimentForm to handle additional phase parameters and improved initial state management. - Modified ExperimentModal to fetch experiment data with phase configuration and ensure unique experiment numbers within the same phase. - Renamed references from "phases" to "books" across ExperimentPhases, PhaseExperiments, and related components for consistency with the new terminology. - Enhanced error handling and validation for new shelling parameters in ExperimentForm. - Updated Supabase interface definitions to reflect changes in experiment and phase data structures.
This commit is contained in:
9
supabase/migrations/00015_experiment_shelling_params.sql
Normal file
9
supabase/migrations/00015_experiment_shelling_params.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Add experiment-level shelling parameters (defaults for repetitions)
|
||||
-- These match the shelling table attributes: ring_gap_inches, drum_rpm
|
||||
|
||||
ALTER TABLE public.experiments
|
||||
ADD COLUMN IF NOT EXISTS ring_gap_inches NUMERIC(6,2) CHECK (ring_gap_inches IS NULL OR ring_gap_inches > 0),
|
||||
ADD COLUMN IF NOT EXISTS drum_rpm INTEGER CHECK (drum_rpm IS NULL OR drum_rpm > 0);
|
||||
|
||||
COMMENT ON COLUMN public.experiments.ring_gap_inches IS 'Default space (inches) between sheller rings for this experiment';
|
||||
COMMENT ON COLUMN public.experiments.drum_rpm IS 'Default sheller drum revolutions per minute for this experiment';
|
||||
Reference in New Issue
Block a user