Fix broken environment migration

This commit is contained in:
Gregory Schier
2025-10-04 05:47:00 -07:00
parent 9c65c95ba9
commit b44ac55bc2
2 changed files with 30 additions and 5 deletions

View File

@@ -68,11 +68,11 @@ export function migrateImport(contents: string) {
// Migrate v4 to v5
for (const environment of parsed.resources.environments ?? []) {
if ('base' in environment && environment.base) {
if ('base' in environment && environment.base && environment.parentModel == null) {
environment.parentModel = 'workspace';
environment.parentId = null;
delete environment.base;
} else if ('base' in environment && !environment.base) {
} else if ('base' in environment && !environment.base && environment.parentModel == null) {
environment.parentModel = 'environment';
environment.parentId = null;
delete environment.base;