M240109103927ReserveServiceDiyTemplate.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace addons\ReservationService\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240109103927ReserveServiceDiyTemplate
  6. */
  7. class M240109103927ReserveServiceDiyTemplate extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. // 需要删除ID为67的那行数据
  15. $this->execute("INSERT INTO `qimall_diy_components` (`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ('commodity-reserve-group', '预约商品组', 'base_goods', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, '', 1, 1634538238, 1634538238);");
  16. // $this->execute("INSERT INTO `qimall_diy_components` (`id`, `code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES (67, 'commodity-reserve-group', '预约商品组', 'base_goods', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, '', 1, 1634538238, 1634538238);");
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function safeDown()
  22. {
  23. echo "M240109103927ReserveServiceDiyTemplate cannot be reverted.\n";
  24. return false;
  25. }
  26. /*
  27. // Use up()/down() to run migration code without a transaction.
  28. public function up()
  29. {
  30. }
  31. public function down()
  32. {
  33. echo "M240109103927ReserveServiceDiyTemplate cannot be reverted.\n";
  34. return false;
  35. }
  36. */
  37. }