forked from ebean-orm/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateDbMigration.java
More file actions
37 lines (29 loc) · 1019 Bytes
/
GenerateDbMigration.java
File metadata and controls
37 lines (29 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main;
import io.ebean.annotation.Platform;
import io.ebean.dbmigration.DbMigration;
import java.io.IOException;
/**
* Generate the DB Migration.
*/
public class GenerateDbMigration {
/**
* Generate the next "DB schema DIFF" migration.
* <p>
* These migration are typically run using FlywayDB, Liquibase
* or Ebean's own built in migration runner.
* </p>
*/
public static void main(String[] args) throws IOException {
// optionally specify the version and name
//System.setProperty("ddl.migration.version", "1.1");
//System.setProperty("ddl.migration.name", "add bars");
// generate a migration using drops from a prior version
//System.setProperty("ddl.migration.pendingDropsFor", "1.2");
DbMigration dbMigration = DbMigration.create();
dbMigration.setPlatform(Platform.POSTGRES);
// dbMigration.setStrictMode(false);
// generate the migration ddl and xml
// ... with EbeanServer in "offline" mode
dbMigration.generateMigration();
}
}