M250211063223AlterQimallAiTool.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250211063223AlterQimallAiTool
  6. */
  7. class M250211063223AlterQimallAiTool extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("ALTER TABLE qimall_ai_tool add sort int(11) not null default 1 COMMENT '排序值';");
  15. $this->execute("INSERT INTO `qimall_ai_tool` (`title`, `url`, `cover`, `is_docking`, `brief_introduction`, `status`, `created_at`, `updated_at`, `sort`) VALUES ( 'deepseek', 'https://chat.deepseek.com', '/static/addons/icon/aiTool/deepseek.png', 0, 'deepseek探索未至之境', 1, 0, 0, 0);");
  16. }
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function safeDown()
  21. {
  22. echo "M250211063223AlterQimallAiTool cannot be reverted.\n";
  23. return false;
  24. }
  25. /*
  26. // Use up()/down() to run migration code without a transaction.
  27. public function up()
  28. {
  29. }
  30. public function down()
  31. {
  32. echo "M250211063223AlterQimallAiTool cannot be reverted.\n";
  33. return false;
  34. }
  35. */
  36. }