@@ -63,11 +63,10 @@ public DdlGenerator(SpiEbeanServer server) {
6363 if (!config .getTenantMode ().isDdlEnabled () && config .isDdlRun ()) {
6464 log .log (WARNING , "DDL can''t be run on startup with TenantMode " + config .getTenantMode ());
6565 this .runDdl = false ;
66- this .useMigrationStoredProcedures = false ;
6766 } else {
6867 this .runDdl = config .isDdlRun ();
69- this .useMigrationStoredProcedures = config .getDatabasePlatform ().useMigrationStoredProcedures ();
7068 }
69+ this .useMigrationStoredProcedures = config .getDatabasePlatform () != null && config .getDatabasePlatform ().useMigrationStoredProcedures ();
7170 this .scriptTransform = createScriptTransform (config );
7271 this .baseDir = initBaseDir ();
7372 }
@@ -85,7 +84,7 @@ private File initBaseDir() {
8584 @ Override
8685 public void execute (boolean online ) {
8786 generateDdl ();
88- if (online ) {
87+ if (online && runDdl ) {
8988 runDdl ();
9089 }
9190 }
@@ -105,16 +104,15 @@ protected void generateDdl() {
105104 /**
106105 * Run the DDL drop and DDL create scripts if properties have been set.
107106 */
108- protected void runDdl () {
109- if (runDdl ) {
110- Connection connection = null ;
111- try {
112- connection = obtainConnection ();
113- runDdlWith (connection );
114- } finally {
115- JdbcClose .rollback (connection );
116- JdbcClose .close (connection );
117- }
107+ @ Override
108+ public void runDdl () {
109+ Connection connection = null ;
110+ try {
111+ connection = obtainConnection ();
112+ runDdlWith (connection );
113+ } finally {
114+ JdbcClose .rollback (connection );
115+ JdbcClose .close (connection );
118116 }
119117 }
120118
0 commit comments