Skip to content

Commit 7e3d50d

Browse files
committed
Added fresh and drop to migrate command
1 parent c51ab73 commit 7e3d50d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/javawebstack/framework/command/MigrateCommand.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
public class MigrateCommand implements Command {
1212

1313
public CommandResult execute(CommandSystem commandSystem, List<String> args, Map<String, List<String>> params) {
14-
if(params.containsKey("f")){
15-
// DROP TABLES
16-
}
1714
if(params.containsKey("a")){
18-
ORM.autoMigrate();
15+
if(params.containsKey("d")){
16+
ORM.autoDrop();
17+
System.out.println("Dropped all tables!");
18+
return CommandResult.success();
19+
}
20+
ORM.autoMigrate(params.containsKey("f"));
1921
System.out.println("Auto-Migration successful!");
2022
return CommandResult.success();
2123
}

0 commit comments

Comments
 (0)