M240627143755AddonsStoreMenuInsert.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240627143755AddonsStoreMenuInsert
  6. */
  7. class M240627143755AddonsStoreMenuInsert extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $time=time();
  15. $sql = <<<SQL
  16. INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES
  17. (60, '下载', '0', 0, '', 0, 'store/client/download/index', 'el-icon-download', 2, 0, 999, NULL, '', 1, $time, $time),
  18. (61, '下载中心', '0', 60, '', 0, 'store/client/download/index', '', 2, 0, 999, NULL, '', 1, $time, $time);
  19. SQL;
  20. $this->execute($sql);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M240627143755AddonsStoreMenuInsert cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }