-- +migrate Up
CREATE TABLE `carts` (
            `id` INT PRIMARY KEY AUTO_INCREMENT,
            `user_id` INT NOT NULL,
            `total_price` DECIMAL(10,2) DEFAULT 0,
            `expire_at` TIMESTAMP NULL,
            `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE INDEX `idx_carts_user_id` ON `carts`(`user_id`);

-- +migrate Down
DROP INDEX `idx_carts_user_id` ON `carts`;
DROP TABLE `carts`;
