CREATE TABLE costing_op_primary_data_sets (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    company_id BIGINT UNSIGNED NOT NULL,
    buyer_id BIGINT UNSIGNED NULL,
    buyer_season VARCHAR(100) NULL,
    style_name VARCHAR(180) NULL,
    fabric VARCHAR(255) NULL,
    wash VARCHAR(500) NULL,
    size_range VARCHAR(100) NULL,
    qty DECIMAL(18,4) NOT NULL DEFAULT 5000,
    productivity_per_hour DECIMAL(18,4) NOT NULL DEFAULT 0,
    test_cost DECIMAL(18,4) NOT NULL DEFAULT 0,
    inspection_cost DECIMAL(18,4) NOT NULL DEFAULT 0,
    fabric_options INT NOT NULL DEFAULT 1,
    wash_options INT NOT NULL DEFAULT 1,
    qty_options INT NOT NULL DEFAULT 1,
    created_by BIGINT UNSIGNED NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP NULL,
    KEY idx_cop_primary_company (company_id, deleted_at),
    CONSTRAINT fk_cop_primary_company FOREIGN KEY (company_id) REFERENCES companies (id),
    CONSTRAINT fk_cop_primary_buyer FOREIGN KEY (buyer_id) REFERENCES buyers (id),
    CONSTRAINT fk_cop_primary_creator FOREIGN KEY (created_by) REFERENCES users (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
