db->schema->getTableSchema('qimall_order_reserve', true); if ($cursor) { if (!$cursor->getColumn('service_start_at')) { $this->execute("alter table qimall_order_reserve add service_start_at int(11) not null default 0 comment'服务开始时间'"); } if (!$cursor->getColumn('service_end_at')) { $this->execute("alter table qimall_order_reserve add service_end_at int(11) not null default 0 comment'服务结束时间'"); } if (!$cursor->getColumn('goods_id')) { $this->execute("alter table qimall_order_reserve add goods_id int(11) not null default 0 comment'商品id'"); } } } /** * {@inheritdoc} */ public function safeDown() { echo "M250225035230OrderReserveAddColumn cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M250225035230OrderReserveAddColumn cannot be reverted.\n"; return false; } */ }