M220812090912InsertQimallLinkCategory.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M220812090912InsertQimallLinkCategory
  6. */
  7. class M220812090912InsertQimallLinkCategory extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function safeDown()
  19. {
  20. echo "M220812090912InsertQimallLinkCategory cannot be reverted.\n";
  21. return false;
  22. }
  23. // Use up()/down() to run migration code without a transaction.
  24. public function up()
  25. {
  26. $table ='qimall_link_category';
  27. $this->insert($table, [
  28. 'name' => 'store',
  29. 'title' => 'O2O门店',
  30. 'pid' => 19,
  31. 'is_list' => 1,
  32. 'remark' => '',
  33. 'status' => 1,
  34. 'created_at' => 1659584481,
  35. 'updated_at' => 1659584481,
  36. ]);
  37. $this->insert($table, [
  38. 'name' => 'store_cate',
  39. 'title' => 'O2O门店分类',
  40. 'pid' => 19,
  41. 'is_list' => 1,
  42. 'remark' => '',
  43. 'status' => 1,
  44. 'created_at' => 1659584481,
  45. 'updated_at' => 1659584481,
  46. ]);
  47. $this->insert($table, [
  48. 'name' => 'store_goods',
  49. 'title' => 'O2O门店商品',
  50. 'pid' => 19,
  51. 'is_list' => 1,
  52. 'remark' => '',
  53. 'status' => 1,
  54. 'created_at' => 1659584481,
  55. 'updated_at' => 1659584481,
  56. ]);
  57. }
  58. public function down()
  59. {
  60. echo "M220812090912InsertQimallLinkCategory cannot be reverted.\n";
  61. return false;
  62. }
  63. }