chore: remove file
All checks were successful
Deploy to Staging / Build Images (push) Successful in 2m23s
Deploy to Staging / Deploy to Staging (push) Successful in 38s
Deploy to Staging / Verify Staging (push) Successful in 7s
Deploy to Staging / Notify Staging Ready (push) Successful in 7s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
All checks were successful
Deploy to Staging / Build Images (push) Successful in 2m23s
Deploy to Staging / Deploy to Staging (push) Successful in 38s
Deploy to Staging / Verify Staging (push) Successful in 7s
Deploy to Staging / Notify Staging Ready (push) Successful in 7s
Deploy to Staging / Notify Staging Failure (push) Has been skipped
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
-- Migration: Alter ownership_costs table to match updated schema
|
|
||||||
-- Issue: #29
|
|
||||||
-- Description: Fix schema mismatch - rename columns, add notes, update constraints
|
|
||||||
|
|
||||||
-- Rename columns to match code expectations
|
|
||||||
ALTER TABLE ownership_costs RENAME COLUMN start_date TO period_start;
|
|
||||||
ALTER TABLE ownership_costs RENAME COLUMN end_date TO period_end;
|
|
||||||
|
|
||||||
-- Make period_start nullable (was NOT NULL as start_date)
|
|
||||||
ALTER TABLE ownership_costs ALTER COLUMN period_start DROP NOT NULL;
|
|
||||||
|
|
||||||
-- Drop interval column (no longer used in new schema)
|
|
||||||
ALTER TABLE ownership_costs DROP COLUMN IF EXISTS interval;
|
|
||||||
|
|
||||||
-- Add notes column
|
|
||||||
ALTER TABLE ownership_costs ADD COLUMN IF NOT EXISTS notes TEXT;
|
|
||||||
|
|
||||||
-- Update description column type to match new schema
|
|
||||||
ALTER TABLE ownership_costs ALTER COLUMN description TYPE VARCHAR(200);
|
|
||||||
|
|
||||||
-- Drop old check constraints
|
|
||||||
ALTER TABLE ownership_costs DROP CONSTRAINT IF EXISTS chk_ownership_costs_type;
|
|
||||||
ALTER TABLE ownership_costs DROP CONSTRAINT IF EXISTS chk_ownership_costs_amount_non_negative;
|
|
||||||
ALTER TABLE ownership_costs DROP CONSTRAINT IF EXISTS chk_ownership_costs_date_range;
|
|
||||||
ALTER TABLE ownership_costs DROP CONSTRAINT IF EXISTS chk_ownership_costs_interval;
|
|
||||||
|
|
||||||
-- Update cost_type column to VARCHAR(32) and add new constraint with additional types
|
|
||||||
ALTER TABLE ownership_costs ALTER COLUMN cost_type TYPE VARCHAR(32);
|
|
||||||
ALTER TABLE ownership_costs ADD CONSTRAINT ownership_costs_cost_type_check
|
|
||||||
CHECK (cost_type IN ('insurance', 'registration', 'tax', 'inspection', 'parking', 'other'));
|
|
||||||
|
|
||||||
-- Add amount constraint (amount > 0)
|
|
||||||
ALTER TABLE ownership_costs ADD CONSTRAINT ownership_costs_amount_check CHECK (amount > 0);
|
|
||||||
Reference in New Issue
Block a user