fix: V9 迁移将 sites.name 改为可空,多名称只用 namesJson
This commit is contained in:
@@ -262,7 +262,6 @@ public class SiteServiceImpl implements SiteService {
|
|||||||
Site existing = siteMapper.selectBySiteId(entry.getSiteId());
|
Site existing = siteMapper.selectBySiteId(entry.getSiteId());
|
||||||
Site site;
|
Site site;
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
if (names != null && !names.isEmpty()) existing.setName(names.get(0));
|
|
||||||
existing.setNamesJson(toJsonArray(names));
|
existing.setNamesJson(toJsonArray(names));
|
||||||
existing.setUrlsJson(toJsonArray(urls));
|
existing.setUrlsJson(toJsonArray(urls));
|
||||||
if (notes != null && !notes.isBlank()) existing.setNotes(notes);
|
if (notes != null && !notes.isBlank()) existing.setNotes(notes);
|
||||||
@@ -279,7 +278,6 @@ public class SiteServiceImpl implements SiteService {
|
|||||||
} else {
|
} else {
|
||||||
site = new Site();
|
site = new Site();
|
||||||
site.setSiteId(entry.getSiteId());
|
site.setSiteId(entry.getSiteId());
|
||||||
site.setName(names != null && !names.isEmpty() ? names.get(0) : entry.getSiteId());
|
|
||||||
site.setNamesJson(toJsonArray(names));
|
site.setNamesJson(toJsonArray(names));
|
||||||
site.setUrlsJson(toJsonArray(urls));
|
site.setUrlsJson(toJsonArray(urls));
|
||||||
site.setNotes(notes);
|
site.setNotes(notes);
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- PAR Flyway V9: name 列改为可空(多名称已用 namesJson 存储)
|
||||||
|
ALTER TABLE sites MODIFY COLUMN name VARCHAR(200) NULL;
|
||||||
Reference in New Issue
Block a user