-
Notifications
You must be signed in to change notification settings - Fork 35
feat: 添加迁移支持 #66
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
base: master
Are you sure you want to change the base?
feat: 添加迁移支持 #66
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.
Pull Request Overview
This PR introduces a migration framework to support database versioning and data migration tasks. The framework allows developers to define migration steps that execute sequentially based on version numbers, with automatic tracking of completed migrations.
Key changes:
- Added a new
muyun-migrationmodule with core migration infrastructure - Implemented version tracking through a dedicated
migration.versiontable - Created test coverage demonstrating migration execution with out-of-order step definitions
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Registered the new muyun-migration module |
| muyun-migration/build.gradle.kts | Defined dependencies for the migration module |
| MigrationController.java | Created controller to manage migration version tracking |
| MigrateAction.java | Defined functional interface for migration actions |
| MigrateStep.java | Implemented migration step record with version validation |
| AbstractMigration.java | Provided base class for implementing migrations with automatic execution |
| TestMigration.java | Added comprehensive tests for migration functionality |
| muyun-boot/build.gradle.kts | Added migration module dependency to the boot module |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
muyun-migration/src/main/java/net/ximatai/muyun/migration/AbstractMigration.java
Outdated
Show resolved
Hide resolved
| Map map = (Map) item; | ||
| Map newMap = new HashMap((Map) item); |
Copilot
AI
Oct 23, 2025
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.
Raw types Map and HashMap are used without generic parameters. Consider using Map<String, Object> and HashMap<> for type safety and to avoid potential ClassCastException at runtime.
|
|
||
| @ApplicationScoped | ||
| class FooController extends BaseScaffold { | ||
| public static final List<Map> initData = List.of( |
Copilot
AI
Oct 23, 2025
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.
Raw type Map is used without generic parameters. Consider using List<Map<String, Object>> for type safety.
| public static final List<Map> initData = List.of( | |
| public static final List<Map<String, Object>> initData = List.of( |
c0e7551 to
e74c6be
Compare
e74c6be to
d518ad0
Compare
d518ad0 to
5a9cece
Compare
使用方式: