Files
silo/migrations/009_item_extended_fields.sql
Forbes fc0eb6d2be feat: add sourcing type, extended fields, and inline project tagging
- Add migration 009: sourcing_type (manufactured/purchased), sourcing_link,
  long_description, and standard_cost columns on items table
- Update Item struct, repository queries, and API handlers for new fields
- Add sourcing badge, long description block, standard cost, and sourcing
  link display to item detail panel
- Add inline project tag editor in detail panel (add/remove via dropdown)
- Add new fields to create and edit modals
- Update CSV import/export for new columns
- Merge with auth CreatedBy/UpdatedBy changes from stash
2026-01-31 14:27:11 -06:00

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);