CREATE TABLE item_code (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(30) NOT NULL,
    item_code_description VARCHAR(255) NULL,
    prefix_id BIGINT UNSIGNED NULL,
    item_type VARCHAR(80) NULL,
    supplier_item_code VARCHAR(100) NULL,
    description VARCHAR(255) NULL,
    composition VARCHAR(255) NULL,
    construction VARCHAR(120) NULL,
    weight VARCHAR(50) NULL,
    weight_type VARCHAR(50) NULL,
    color_id BIGINT UNSIGNED NULL,
    finish_id BIGINT UNSIGNED NULL,
    width_1 VARCHAR(50) NULL,
    width_type_1 VARCHAR(50) NULL,
    width_2 VARCHAR(50) NULL,
    width_type_2 VARCHAR(50) NULL,
    tex VARCHAR(50) NULL,
    tkt VARCHAR(50) NULL,
    yarn_count VARCHAR(50) NULL,
    length_value VARCHAR(50) NULL,
    default_uom_id BIGINT UNSIGNED NULL,
    future_1 VARCHAR(120) NULL,
    future_2 VARCHAR(120) NULL,
    future_3 VARCHAR(120) NULL,
    future_4 VARCHAR(120) NULL,
    future_5 VARCHAR(120) NULL,
    future_6 VARCHAR(120) NULL,
    other_information TEXT NULL,
    supplier_id BIGINT UNSIGNED NULL,
    status ENUM('active', 'inactive') NOT NULL DEFAULT 'active',
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    deleted_at TIMESTAMP NULL,
    UNIQUE KEY uq_item_code (code),
    KEY idx_item_code_prefix (prefix_id),
    KEY idx_item_code_supplier (supplier_id),
    KEY idx_item_code_type (item_type),
    CONSTRAINT fk_item_code_prefix FOREIGN KEY (prefix_id) REFERENCES prefix_masters (id),
    CONSTRAINT fk_item_code_color FOREIGN KEY (color_id) REFERENCES colors (id),
    CONSTRAINT fk_item_code_finish FOREIGN KEY (finish_id) REFERENCES metal_finishes (id),
    CONSTRAINT fk_item_code_uom FOREIGN KEY (default_uom_id) REFERENCES unit_masters (id),
    CONSTRAINT fk_item_code_supplier FOREIGN KEY (supplier_id) REFERENCES suppliers (id)
) ENGINE=InnoDB;
