-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-475 Add config migrations #475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall
|
||
import static com.eternalcode.core.configuration.migration.MigrationStep.move; | ||
|
||
public class PC1 extends AbstractMigration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this name isn’t too generic? We should use something more understandable.
} | ||
|
||
@Override | ||
public int migrationNumber() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can base order of migrations on list order. #475 (comment)
|
||
public class MigrateFactory { | ||
|
||
private final List<Migration> migrations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this list ^
I want migrate to okaeri-configs for built-in migrations and better yaml parsing. |
I plan to merge this only AFTER the first release.
This pull request introduces a migration system within the configuration. The purpose of this system is to facilitate easy key changes in the configuration while maintaining compatibility with older data.
Here's an example of a migration:
In the above example, "PC" stands for "PluginConfiguration," and "1" is the migration number. The same convention will be applied to other migrations as well.
⚠ It's worth noting that the migration system itself is in its early development stages and will likely require numerous refinements to achieve optimal functionality.
2023-08-23.13-12-04.mov