-- ============================================================
-- Style Marker Details — uploadable marker/lay-plan reference docs
-- shown on the Consumption tab of the Style workspace
-- ============================================================

SET FOREIGN_KEY_CHECKS = 0;

CREATE TABLE IF NOT EXISTS `style_marker_documents` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `company_id` int unsigned NOT NULL DEFAULT 1,
  `style_id` int unsigned NOT NULL,
  `doc_name` varchar(255) DEFAULT NULL COMMENT 'Original file name',
  `file_path` varchar(500) DEFAULT NULL COMMENT 'Relative path under /uploads/style-markers/',
  `file_type` varchar(20) DEFAULT NULL COMMENT 'jpg, pdf, xlsx, dwg, etc.',
  `marker_type` varchar(50) DEFAULT NULL COMMENT 'marker, lay_plan, cut_plan, pattern, spec, other',
  `notes` text COMMENT 'Reference notes',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `style_id` (`style_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

SET FOREIGN_KEY_CHECKS = 1;
