Fix data migration not executing when data_version is outdated#80
Conversation
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
|
@copilot But the data is not in the same struture you can check |
…nces Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
…ilding Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Fixed in commit cacd29a. The issue was that version 2 data already has
The migration should now properly detect and migrate version 2 data to version 3. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Successfully migrated 0 spawners from version 2 to version 3 why 0 spawner, in data file I'm currently having 8359 [14:24:56 INFO]: [SmartSpawner] Enabling SmartSpawner v1.5.4.3 |
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Fixed in commit d9c13e7. The issue was that version 2 data has 12 fields (not 11 as initially assumed). The old converter created 12 fields including Updated the migration to handle both 11 and 12 field formats:
The migration should now properly detect and migrate all 8359 spawners from version 2 to version 3. |
Fix data migration not executing when data_version exists but is outdated
Problem Analysis:
The migration was reporting "Successfully migrated 0 spawners" because version 2 data actually has 12 fields (not 11), but the migration code was only checking for exactly 11 fields. The old converter created 12 fields including
allowEquipmentItems, but the migration logic was looking for 11 fields only.Root Cause:
allowEquipmentItemswas included)if (settings.length == 11)which never matched the actual data with 12 fieldsChanges Made:
settings.length >= 11 && settings.length <= 12allowEquipmentItemsvalue asisAtCapacitywhen migrating 12-field formatTechnical Details:
Modified
SpawnerDataMigration.java:VERSION_2_SETTINGS_FIELD_COUNT = 11toVERSION_2_MIN_SETTINGS_FIELD_COUNT = 11andVERSION_2_MAX_SETTINGS_FIELD_COUNT = 12allowEquipmentItems(field 11 in 12-field version) asisAtCapacitywhen migratingMigration Logic:
The migration now inserts
maxStackSizeat position 10 and usesallowEquipmentItems(if present) forisAtCapacity.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.