diff --git a/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java b/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java index 33b918f80..805a176c0 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java +++ b/src/main/java/com/avaje/ebean/dbmigration/DbMigration.java @@ -40,6 +40,18 @@ import java.util.List; * changes and a series of sql scripts to apply, rollback the applied changes if necessary * and drop objects (drop tables, drop columns). *
+ *+ * This does not run the migration or ddl scripts but just generates them. + *
+ *{@code
+ *
+ * DbMigration migration = new DbMigration();
+ * migration.setPathToResources("src/main/resources");
+ * migration.setPlatform(DbPlatformName.ORACLE);
+ *
+ * migration.generateMigration();
+ *
+ * }
*/
public class DbMigration {
@@ -131,9 +143,36 @@ public class DbMigration {
}
/**
- * Run the migration generating the next migration xml file and associated apply and rollback sql scripts.
+ * Generate the next migration xml file and associated apply and rollback sql scripts.
+ * + * This does not run the migration or ddl scripts but just generates them. + *
+ *{@code
+ *
+ * DbMigration migration = new DbMigration();
+ * migration.setPathToResources("src/main/resources");
+ * migration.setPlatform(DbPlatformName.ORACLE);
+ *
+ * migration.generateMigration();
+ *
+ * }
+ *
+ * {@code
+ *
+ * DbMigration migration = new DbMigration();
+ * migration.setPathToResources("src/main/resources");
+ *
+ * migration.addPlatform(DbPlatformName.POSTGRES, "pg");
+ * migration.addPlatform(DbPlatformName.MYSQL, "mysql");
+ * migration.addPlatform(DbPlatformName.ORACLE, "mysql");
+ *
+ * migration.generateMigration();
+ *
+ * }
*/
- public void runMigration() throws IOException {
+ public void generateMigration() throws IOException {
// use this flag to stop other plugins like full DDL generation
DbOffline.setRunningMigration();