| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- *
- * Class M221208033824AddTradeOrderNoToPaymentRefund
- */
- class M221208033824AddTradeOrderNoToPaymentRefund extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $res = \Yii::$app->db->schema->getTableSchema("qimall_payment_refund",true);
- if(!$res->getColumn('trade_order_no')){
- $sql = "ALTER TABLE `qimall_payment_refund`
- ADD COLUMN `trade_order_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易流水订单号';";
- $this->execute($sql);
- $sql = "INSERT INTO `qimall_global_var_map` ( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at` ) VALUES ( 'GroupBuy', '拼团', 'FromTypeMap', '1', '1', '1654569888', '1654569888' );";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M221208033824AddTradeOrderNoToPaymentRefund cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M221208033824AddTradeOrderNoToPaymentRefund cannot be reverted.\n";
- return false;
- }
- */
- }
|