| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230831033921AlterQimallAddonsStoreSettings
- */
- class M230831033921AlterQimallAddonsStoreSettings extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `qimall_addons_store_settings`
- ADD COLUMN `enable_discount_price` tinyint(1) NOT NULL DEFAULT 0 COMMENT '启用折扣价格 1:启用;0禁用',
- ADD COLUMN `discount_price_scale` decimal(6, 2) NOT NULL DEFAULT 0.00 COMMENT '折扣比例设置';";
- $this->execute($sql);
- $sql = "ALTER TABLE `qimall_addons_store_commission`
- ADD COLUMN `store_contributing_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '折扣金额';";
- $this->execute($sql);
- $sql = "INSERT INTO `qimall_global_var_map`(`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('store_consumption_rewards', '消费奖励', 'CapitalTypeMap', 1, 1, 1654569888, 1654569888);";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230831033921AlterQimallAddonsStoreSettings cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230831033921AlterQimallAddonsStoreSettings cannot be reverted.\n";
- return false;
- }
- */
- }
|