-- +migrate Up
CREATE TABLE IF NOT EXISTS `license_orders` (
	`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT '注文ID',
	`po_number` VARCHAR(50) COMMENT '発注番号',
	`from_account_id` BIGINT UNSIGNED NOT NULL COMMENT '注文元アカウントID',
	`to_account_id` BIGINT UNSIGNED NOT NULL COMMENT '注文先アカウントID',
	`ordered_at` TIMESTAMP DEFAULT now() NOT NULL COMMENT '注文日時',
	`issued_at` TIMESTAMP COMMENT '発行日時',
	`quantity` INT UNSIGNED NOT NULL COMMENT '注文ライセンス数',
	`status` VARCHAR(255) NOT NULL COMMENT '注文状態',
	`canceled_at` TIMESTAMP COMMENT '注文キャンセル日時'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-- +migrate Down
DROP TABLE `license_orders`;