flyway_repaire_migrate_38.sql 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. -- IM服务在2020.10.6-2020-11.2号之间的版本升级到最新版本时,可能会提示出现如下的错误:
  2. -- Exception in thread "main" org.flywaydb.core.api.FlywayException: Validate failed: Detected resolved migration not applied to database: 38
  3. -- at org.flywaydb.core.Flyway.doValidate(Flyway.java:1482)
  4. -- at org.flywaydb.core.Flyway.access$100(Flyway.java:85)
  5. -- at org.flywaydb.core.Flyway$1.execute(Flyway.java:1364)
  6. -- at org.flywaydb.core.Flyway$1.execute(Flyway.java:1356)
  7. -- ...
  8. --
  9. -- 当出现这个问题后,执行这个sql就可以修复了。
  10. --
  11. --
  12. DROP TABLE IF EXISTS `t_file`;
  13. CREATE TABLE `t_file` (
  14. `_mid` bigint(20) NOT NULL PRIMARY KEY,
  15. `_from` varchar(64) NOT NULL,
  16. `_type` tinyint NOT NULL DEFAULT 0,
  17. `_target` varchar(64) NOT NULL,
  18. `_line` int(11) NOT NULL DEFAULT 0,
  19. `_name` varchar(128) DEFAULT '',
  20. `_url` varchar(1024) NOT NULL DEFAULT '',
  21. `_size` int(11) NOT NULL DEFAULT 0,
  22. `_download_count` int(11) DEFAULT 0,
  23. `_dt` bigint(20) NOT NULL,
  24. INDEX `file_conv_index` (`_type`, `_line`, `_target`, `_mid`),
  25. INDEX `file_user_index` (`_from`, `_mid`)
  26. )
  27. ENGINE = InnoDB
  28. DEFAULT CHARACTER SET = utf8mb4
  29. COLLATE = utf8mb4_unicode_ci;
  30. alter table `t_group` modify column `_searchable` int(11) NOT NULL DEFAULT 0;
  31. update flyway_schema_history set installed_rank = 40 where version = 40;
  32. insert into flyway_schema_history values (38,'38','alter group searchable column','SQL','V38__alter_group_searchable_column.sql',-524664704,'root','2020-07-21 14:43:50',1126,1),(39,'39','create files table','SQL','V39__create_files_table.sql',1144437159,'root','2020-08-03 03:15:04',503,1);