- Fix FreeCAD Push command: compare local file mtime against server's latest file revision timestamp instead of just checking file existence. Previously, any file already uploaded (even at an older revision) was skipped, causing 'All local files are already uploaded' when local files were newer. - Add SiloClient.latest_file_revision() helper method - Renumber 009_item_extended_fields.sql to 010 to avoid collision with 009_auth.sql from the auth system
22 lines
977 B
SQL
22 lines
977 B
SQL
-- Migration 009: Extended Item Fields
|
|
--
|
|
-- Adds sourcing classification, sourcing link, long description, and standard cost
|
|
-- directly to the items table for first-class item metadata.
|
|
|
|
-- Sourcing type: manufactured in-house vs. purchased/COTS
|
|
-- Using a check constraint rather than an enum for flexibility.
|
|
ALTER TABLE items ADD COLUMN sourcing_type VARCHAR(20) NOT NULL DEFAULT 'manufactured'
|
|
CHECK (sourcing_type IN ('manufactured', 'purchased'));
|
|
|
|
-- Sourcing link: URL to supplier page, datasheet, or procurement source
|
|
ALTER TABLE items ADD COLUMN sourcing_link TEXT;
|
|
|
|
-- Long description: extended description for detailed specifications, notes, etc.
|
|
ALTER TABLE items ADD COLUMN long_description TEXT;
|
|
|
|
-- Standard cost: baseline unit cost for budgeting/estimation (precision: up to $9,999,999.99)
|
|
ALTER TABLE items ADD COLUMN standard_cost DECIMAL(12, 4);
|
|
|
|
-- Index on sourcing_type for filtering
|
|
CREATE INDEX idx_items_sourcing_type ON items(sourcing_type);
|