| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- use common\models\backend\Menu;
- /**
- * Class M240622031817UpdateQimallRbacAuthItemTable
- */
- class M240622031817UpdateQimallRbacAuthItemTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $res = Menu::migrateUpdateMenu();
- if ($res === false) throw new \Exception(Menu::getStaticError());
- }catch (\Exception $e){
- \Yii::error('根据菜单补全权限错误:' . $e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240622031817UpdateQimallRbacAuthItemTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240622031817UpdateQimallRbacAuthItemTable cannot be reverted.\n";
- return false;
- }
- */
- }
|