CREATE TABLE style_info_sample_requests (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    style_info_id BIGINT UNSIGNED NOT NULL,
    company_id BIGINT UNSIGNED NOT NULL,
    sample_size VARCHAR(80) NULL,
    color_id BIGINT UNSIGNED NULL,
    color_name VARCHAR(120) NULL,
    wash VARCHAR(120) NULL,
    qty DECIMAL(12,2) NULL,
    fabric VARCHAR(180) NULL,
    remarks VARCHAR(500) NULL,
    sort_order INT NOT NULL DEFAULT 0,
    created_by BIGINT UNSIGNED 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_style_sample_style (style_info_id, deleted_at),
    KEY idx_style_sample_company (company_id),
    CONSTRAINT fk_style_sample_style FOREIGN KEY (style_info_id) REFERENCES style_infos (id),
    CONSTRAINT fk_style_sample_company FOREIGN KEY (company_id) REFERENCES companies (id),
    CONSTRAINT fk_style_sample_color FOREIGN KEY (color_id) REFERENCES colors (id)
) ENGINE=InnoDB;
