M220812091001InsertQimallLinkCategory.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace addons\Mch\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220812091001InsertQimallLinkCategory
  6. */
  7. class M220812091001InsertQimallLinkCategory extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "INSERT INTO `qimall_link_category`(`id`, `name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES (33, 'mch', '多商户', 19, 1, '', 1, 1654741229, 1663729697)";
  16. $this->execute($sql);
  17. $sql = "INSERT INTO `qimall_link_category`(`id`, `name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES (34, 'mch_cate', '多商户分类', 19, 1, '', 1, 1654741255, 1663729702)";
  18. $this->execute($sql);
  19. }catch (\Exception $e){
  20. }
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function safeDown()
  26. {
  27. echo "M220812091001InsertQimallLinkCategory cannot be reverted.\n";
  28. return false;
  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 "M220812091001InsertQimallLinkCategory cannot be reverted.\n";
  37. return false;
  38. }
  39. }