-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to migrate challenges from 0.5.0 - 0.7.5 data storage mod…
…e to new 0.8.0 format. Part of implementing #105
- Loading branch information
Showing
5 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/world/bentobox/challenges/commands/admin/MigrateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package world.bentobox.challenges.commands.admin; | ||
|
||
|
||
import java.util.List; | ||
|
||
import world.bentobox.bentobox.api.addons.Addon; | ||
import world.bentobox.bentobox.api.commands.CompositeCommand; | ||
import world.bentobox.bentobox.api.user.User; | ||
import world.bentobox.challenges.ChallengesAddon; | ||
|
||
|
||
public class MigrateCommand extends CompositeCommand { | ||
|
||
/** | ||
* Migrates challenges | ||
* @param addon | ||
* @param cmd | ||
*/ | ||
public MigrateCommand(Addon addon, CompositeCommand cmd) { | ||
super(addon, cmd, "migrate"); | ||
} | ||
|
||
@Override | ||
public boolean execute(User user, String label, List<String> args) { | ||
((ChallengesAddon)getAddon()).getChallengesManager().migrateDatabase(user, getWorld()); | ||
|
||
return true; | ||
} | ||
|
||
|
||
@Override | ||
public void setup() { | ||
this.setPermission("challenges.admin"); | ||
this.setParametersHelp("challenges.commands.admin.migrate.parameters"); | ||
this.setDescription("challenges.commands.admin.migrate.description"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters