M230109110505InsertIntoQimallLink.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230109110505InsertIntoQimallLink
  6. */
  7. class M230109110505InsertIntoQimallLink extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "
  16. INSERT INTO `qimall_link` (`name`, `title`, `cat_id`, `open_type`, `route`, `remark`, `status`, `created_at`, `updated_at`) VALUES ( '', '全部分类2', 4, 'page', '/plugins3/menu/index', '', 1, 1634096281, 1636011379);
  17. INSERT INTO `qimall_diy_components` (`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ('img-ad-swiper', '轮播图片', 'img_text', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, '', 1, 1634538238, 1634538238);
  18. ";
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M230109110505InsertIntoQimallLink 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 "M221111063020InsertIntoQimallTown cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }