M230522110924InserTableMenu.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230522110924InserTableMenu
  6. */
  7. class M230522110924InserTableMenu extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "INSERT INTO `qimall_menu`
  16. (`title`, `app_id`, `cate_id`, `addons_name`, `is_addon`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`)
  17. VALUES
  18. ('自定义规格', 'backend', 2, '', 0, 32, 'mall/specs/index', '', 2, 0, 999, NULL, ' tr_32', 1, 1684724864, 1684724864);";
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M230522110924InserTableMenu cannot be reverted.\n";
  29. return false;
  30. }
  31. /*
  32. // Use up()/down() to run migration code without a transaction.
  33. public function up()
  34. {
  35. }
  36. public function down()
  37. {
  38. echo "M230228081131InsertQimallMenu cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }