Package org.flywaydb.database.sqlserver
Class SQLServerSchema
- java.lang.Object
-
- org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
-
- org.flywaydb.database.sqlserver.SQLServerSchema
-
- Direct Known Subclasses:
SynapseSchema
public class SQLServerSchema extends org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SQLServerSchema.DBObject
SQL Server object meta-data.protected static class
SQLServerSchema.ObjectType
SQL Server object types for which we support automatic clean-up.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
databaseName
-
Constructor Summary
Constructors Constructor Description SQLServerSchema(org.flywaydb.core.internal.jdbc.JdbcTemplate jdbcTemplate, SQLServerDatabase database, java.lang.String databaseName, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>
cleanObjects(java.lang.String dropQualifier, SQLServerSchema.ObjectType... objectTypes)
protected java.util.List<java.lang.String>
cleanRules()
protected java.util.List<java.lang.String>
cleanSynonyms()
protected java.util.List<java.lang.String>
cleanTriggers()
protected SQLServerTable[]
doAllTables()
protected void
doClean()
protected void
doCreate()
protected void
doDrop()
protected boolean
doEmpty()
protected boolean
doExists()
org.flywaydb.core.internal.database.base.Table
getTable(java.lang.String tableName)
protected java.util.List<SQLServerSchema.DBObject>
queryDBObjects(SQLServerSchema.ObjectType... types)
Query objects with any of the given types.
-
-
-
Constructor Detail
-
SQLServerSchema
public SQLServerSchema(org.flywaydb.core.internal.jdbc.JdbcTemplate jdbcTemplate, SQLServerDatabase database, java.lang.String databaseName, java.lang.String name)
-
-
Method Detail
-
doExists
protected boolean doExists() throws java.sql.SQLException
- Specified by:
doExists
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
doEmpty
protected boolean doEmpty() throws java.sql.SQLException
- Specified by:
doEmpty
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
doCreate
protected void doCreate() throws java.sql.SQLException
- Specified by:
doCreate
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
doDrop
protected void doDrop() throws java.sql.SQLException
- Specified by:
doDrop
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
doClean
protected void doClean() throws java.sql.SQLException
- Specified by:
doClean
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
queryDBObjects
protected java.util.List<SQLServerSchema.DBObject> queryDBObjects(SQLServerSchema.ObjectType... types) throws java.sql.SQLException
Query objects with any of the given types.- Parameters:
types
- The object types to be queried.- Returns:
- The found objects.
- Throws:
java.sql.SQLException
- when the retrieval failed.
-
cleanTriggers
protected java.util.List<java.lang.String> cleanTriggers() throws java.sql.SQLException
- Returns:
- The drop statements.
- Throws:
java.sql.SQLException
- when the clean statements could not be generated.
-
cleanSynonyms
protected java.util.List<java.lang.String> cleanSynonyms() throws java.sql.SQLException
- Returns:
- The drop statements.
- Throws:
java.sql.SQLException
- when the clean statements could not be generated.
-
cleanRules
protected java.util.List<java.lang.String> cleanRules() throws java.sql.SQLException
- Returns:
- The drop statements.
- Throws:
java.sql.SQLException
- when the clean statements could not be generated.
-
cleanObjects
protected java.util.List<java.lang.String> cleanObjects(java.lang.String dropQualifier, SQLServerSchema.ObjectType... objectTypes) throws java.sql.SQLException
- Parameters:
dropQualifier
- The type of DROP statement to issue.objectTypes
- The type of objects to drop.- Returns:
- The drop statements.
- Throws:
java.sql.SQLException
- when the clean statements could not be generated.
-
doAllTables
protected SQLServerTable[] doAllTables() throws java.sql.SQLException
- Specified by:
doAllTables
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
- Throws:
java.sql.SQLException
-
getTable
public org.flywaydb.core.internal.database.base.Table getTable(java.lang.String tableName)
- Specified by:
getTable
in classorg.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,SQLServerTable>
-
-