-- migrate:up
CREATE TABLE
    order_detail (
        id INT NOT NULL AUTO_INCREMENT,
        order_id INT NOT NULL,
        order_sn varchar(50) NOT NULL,
        order_item_id BIGINT NOT NULL,
        item_name VARCHAR(255) NOT NULL,
        model_id BIGINT NOT NULL,
        model_quantity_purchased BIGINT NOT NULL,
        model_discounted_price DECIMAL(10, 2) NOT NULL,
        model_original_price DECIMAL(10, 2) NOT NULL,
        image_url VARCHAR(255) NOT NULL,
        model_sku VARCHAR(100) DEFAULT NULL,
        item_sku varchar(100) DEFAULT NULL,
        PRIMARY KEY (id),
        FOREIGN KEY (order_id) REFERENCES orders (id) ON DELETE CASCADE
    ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

-- migrate:down
DROP TABLE IF EXISTS order_detail;