-- migrate:up
CREATE TABLE queue_shipment (
    id INT AUTO_INCREMENT PRIMARY KEY,
    order_sn varchar(50) NOT NULL,
    shop_id INT NOT NULL,
    access_token VARCHAR(255) NOT NULL,
    refresh_token VARCHAR(255) NOT NULL,
    log_json JSON DEFAULT NULL,
    platform_id INT NOT NULL,
    flag_delete BOOLEAN DEFAULT 0,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (platform_id) REFERENCES platform (id) ON DELETE CASCADE
);

-- migrate:down
DROP TABLE IF EXISTS queue_shipment;