| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace addons\Printer\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240618081503CreateQimallPrintLogTable
- */
- class M240618081503CreateQimallPrintLogTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_printer_log` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mch_id` int(11) NOT NULL DEFAULT 0 COMMENT '多商户id,0表示商城订单',
- `store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
- `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
- `order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
- `type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '打印类型,1: 下单,2: 支付,3: 确认收货,4: 后台',
- `created_at` int(11) NOT NULL DEFAULT 0,
- `updated_at` int(11) NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1402 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='订单打印日志' ROW_FORMAT=DYNAMIC;
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- echo "Error creating table qimall_addons_printer_log: " . $e->getMessage() . "\n";
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240618081503CreateQimallPrintLogTable cannot be reverted.\n";
- return false;
- }
- }
|