| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M220906060337AddCreditRateColumnToQimallAddonsStoreCashierExtra
- */
- class M220906060337AddCreditRateColumnToQimallAddonsStoreCashierExtra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $this->execute("ALTER TABLE qimall_addons_store_cashier_extra add `credit_rate` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '赊账比例'");
- } catch (\Exception $e) {
- var_dump($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M220906060337AddCreditRateColumnToQimallAddonsStoreCashierExtra cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M220906060337AddCreditRateColumnToQimallAddonsStoreCashierExtra cannot be reverted.\n";
- return false;
- }
- */
- }
|