| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M250108104921AddOrderSourceToOrderRefund
- */
- class M250108104921AddOrderSourceToOrderRefund extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $res = \Yii::$app->db->schema->getTableSchema("qimall_order_refund",true);
- if(!$res->getColumn('order_source')){
- $sql = "ALTER TABLE `qimall_order_refund` ADD COLUMN `order_source` varchar(20) NOT NULL DEFAULT '' COMMENT '订单来源';";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250108104921AddOrderSourceToOrderRefund cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250108104921AddOrderSourceToOrderRefund cannot be reverted.\n";
- return false;
- }
- */
- }
|