fix: V9 迁移将 sites.name 改为可空,多名称只用 namesJson

This commit is contained in:
mediabot-pt
2026-06-30 13:09:12 +08:00
parent 63c2601822
commit 1667bdd145
2 changed files with 2 additions and 2 deletions

View File

@@ -262,7 +262,6 @@ public class SiteServiceImpl implements SiteService {
Site existing = siteMapper.selectBySiteId(entry.getSiteId());
Site site;
if (existing != null) {
if (names != null && !names.isEmpty()) existing.setName(names.get(0));
existing.setNamesJson(toJsonArray(names));
existing.setUrlsJson(toJsonArray(urls));
if (notes != null && !notes.isBlank()) existing.setNotes(notes);
@@ -279,7 +278,6 @@ public class SiteServiceImpl implements SiteService {
} else {
site = new Site();
site.setSiteId(entry.getSiteId());
site.setName(names != null && !names.isEmpty() ? names.get(0) : entry.getSiteId());
site.setNamesJson(toJsonArray(names));
site.setUrlsJson(toJsonArray(urls));
site.setNotes(notes);

View File

@@ -0,0 +1,2 @@
-- PAR Flyway V9: name 列改为可空(多名称已用 namesJson 存储)
ALTER TABLE sites MODIFY COLUMN name VARCHAR(200) NULL;