-- migrate:up
CREATE TABLE
    orders (
        id int NOT NULL AUTO_INCREMENT,
        order_sn varchar(50) NOT NULL,
        shop_id BIGINT NOT NULL,
        buyer_user_id BIGINT DEFAULT NULL,
        id_packing_list BIGINT DEFAULT NULL,
        buyer_username varchar(100) DEFAULT NULL,
        order_status varchar(50) NOT NULL,
        payment_method varchar(50) DEFAULT NULL,
        total_amount decimal(10, 2) DEFAULT NULL,
        currency varchar(10) DEFAULT NULL,
        create_time datetime DEFAULT NULL,
        pay_time datetime DEFAULT NULL,
        ship_by_date datetime DEFAULT NULL,
        zipcode varchar(10) DEFAULT NULL,
        awb_url VARCHAR(255) DEFAULT NULL,
        loc varchar(255) NULL,
        product_location_id varchar(255) NULL,
        shipping_carrier varchar(255) NULL,
        address_id BIGINT DEFAULT NULL,
        PRIMARY KEY (id),
        UNIQUE KEY order_sn (order_sn)
    ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-- migrate:down
DROP TABLE IF EXISTS orders;