Files
PriceForge/migrations/045_create_ignore_rules.sql
Mikhail Chusavitin 5f8aec456b Unified Quote Journal (parts_log) v3
- New unified append-only quote log table parts_log replaces three
  separate log tables (stock_log, partnumber_log_competitors, lot_log)
- Migrations 042-049: extend supplier, create parts_log/import_formats/
  ignore_rules, rework qt_lot_metadata composite PK, add lead_time_weeks
  to pricelist_items, backfill data, migrate ignore rules
- New services: PartsLogBackfillService, ImportFormatService,
  UnifiedImportService; new world pricelist type (all supplier types)
- qt_lot_metadata PK changed to (lot_name, pricelist_type); all queries
  now filter WHERE pricelist_type='estimate'
- Fix pre-existing bug: qt_component_usage_stats column names
  quotes_last30d/quotes_last7d (no underscore) — added explicit gorm tags
- Bible: full table inventory, baseline schema snapshot, updated pricelist/
  data-rules/api/history/architecture docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 17:25:54 +03:00

14 lines
732 B
SQL

-- Ignore rules table: structured ignore patterns for unified import pipeline.
-- Replaces the per-field ignore logic scattered across stock_mappings.go.
-- Check order at import: ignore → mapping → insert.
CREATE TABLE IF NOT EXISTS qt_ignore_rules (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
field ENUM('partnumber','vendor','description') NOT NULL,
match_type ENUM('exact','glob','contains') NOT NULL DEFAULT 'exact',
pattern VARCHAR(500) NOT NULL,
note VARCHAR(500) NULL,
created_by VARCHAR(100) NOT NULL DEFAULT '',
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX idx_ignore_field (field, match_type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;