M240705145203InsertQimallDiyComponents.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240705145203InsertQimallDiyComponents
  6. */
  7. class M240705145203InsertQimallDiyComponents extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = "INSERT INTO `qimall_diy_components`(`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES
  16. ('bg-music', '背景音乐', 'img_text', '', 1, 0, '{\"is_drag\":\"false\",\"is_up\":\"false\",\"id_down\":\"false\",\"is_copy\":\"false\"}', 999, '', 1, 1634538238, 1634538238),
  17. ('order-multi-broadcast', '多订单播报', 'img_text', '', 1, 0, '{\"is_drag\":\"false\",\"is_up\":\"false\",\"id_down\":\"false\",\"is_copy\":\"false\"}', 999, '', 1, 1634538238, 1634538238);";
  18. $this->execute($sql);
  19. } catch (\Exception $e) {
  20. \Yii::error('M240705145203InsertQimallDiyComponents:' . $e->getMessage());
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M240705145203InsertQimallDiyComponents 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 "M240705145203InsertQimallDiyComponents cannot be reverted.\n";
  39. return false;
  40. }
  41. */
  42. }