| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace addons\Store\console\migrations;
- use addons\Store\common\models\StoreAdmin;
- use yii\db\Migration;
- /**
- * Class M240716083948AlterQimallAddonsStoreAdmin
- */
- class M240716083948AlterQimallAddonsStoreAdmin extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $res = StoreAdmin::find()->orderBy('id desc')->one();
- if(!empty($res)){
- $start = $res['id']+1;
- $sql="alter table qimall_addons_store_admin auto_increment = {$start}";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240716083948AlterQimallAddonsStoreAdmin cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240716083948AlterQimallAddonsStoreAdmin cannot be reverted.\n";
- return false;
- }
- */
- }
|