Class SQLServerSchema

    • 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  
      • Fields inherited from class org.flywaydb.core.internal.database.base.Schema

        database, jdbcTemplate, name
    • Constructor Summary

      Constructors 
      Constructor Description
      SQLServerSchema​(org.flywaydb.core.internal.jdbc.JdbcTemplate jdbcTemplate, SQLServerDatabase database, java.lang.String databaseName, java.lang.String name)  
    • Field Detail

      • databaseName

        protected final java.lang.String databaseName
    • 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 class org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,​SQLServerTable>
        Throws:
        java.sql.SQLException
      • doEmpty

        protected boolean doEmpty()
                           throws java.sql.SQLException
        Specified by:
        doEmpty in class org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,​SQLServerTable>
        Throws:
        java.sql.SQLException
      • doCreate

        protected void doCreate()
                         throws java.sql.SQLException
        Specified by:
        doCreate in class org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,​SQLServerTable>
        Throws:
        java.sql.SQLException
      • doDrop

        protected void doDrop()
                       throws java.sql.SQLException
        Specified by:
        doDrop in class org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,​SQLServerTable>
        Throws:
        java.sql.SQLException
      • doClean

        protected void doClean()
                        throws java.sql.SQLException
        Specified by:
        doClean in class org.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 class org.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 class org.flywaydb.core.internal.database.base.Schema<SQLServerDatabase,​SQLServerTable>