ebean-orm / ebean-migration

DB Migration runner (similar to Flyway) which can be used standalone or with Ebean (run migrations on EbeanServer start)
Apache License 2.0
9 stars 5 forks source link

FIX: createSchemaIfNeeded for SQLServer #24

Closed rPraml closed 7 years ago

rPraml commented 7 years ago

This fixes createSchemaIfNeeded for Microsoft SQLServer

What does NOT work:

PreparedStatement query = connection.prepareStatement("CREATE SCHEMA " + dbSchema);
query.execute();
Statement query = connection.createStatement();
query.execute("CREATE SCHEMA " + dbSchema);
PreparedStatement query = connection.prepareStatement("CREATE SCHEMA " + dbSchema);
query.executeUpdate();

all of them will throw com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'SCHEMA'

rbygrave commented 7 years ago

Thanks