Class Flyway

  • All Implemented Interfaces:
    Configuration

    public class Flyway
    extends Object
    implements Configuration
    This is the centre point of Flyway, and for most users, the only class they will ever have to deal with.

    It is THE public API from which all important Flyway functions such as clean, validate and migrate can be called.

    To get started all you need to do is

     Flyway flyway = Flyway.configure().dataSource(url, user, password).load();
     flyway.migrate();
     

    Deprecation warning: starting with Flyway 6.0 this class will no longer implement the Configuration interface.

    • Constructor Summary

      Constructors 
      Constructor Description
      Flyway()
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Flyway​(ClassLoader classLoader)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Flyway​(Configuration configuration)
      Creates a new instance of Flyway with this configuration.
      Flyway​(FlywayConfiguration configuration)
      Deprecated.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void baseline()
      Baselines an existing database, excluding all migrations up to and including baselineVersion.
      void clean()
      Drops all objects (tables, views, procedures, triggers, ...) in the configured schemas.
      static FluentConfiguration configure()
      This is your starting point.
      static FluentConfiguration configure​(ClassLoader classLoader)
      This is your starting point.
      void configure​(Map<String,​String> props)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void configure​(Properties properties)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getBaselineDescription()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      MigrationVersion getBaselineVersion()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Callback[] getCallbacks()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      ClassLoader getClassLoader()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Configuration getConfiguration()  
      int getConnectRetries()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      DataSource getDataSource()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      OutputStream getDryRunOutput()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Charset getEncoding()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      ErrorHandler[] getErrorHandlers()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String[] getErrorOverrides()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getInitSql()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getInstalledBy()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getLicenseKey()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Location[] getLocations()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getPlaceholderPrefix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      Map<String,​String> getPlaceholders()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getPlaceholderSuffix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getRepeatableSqlMigrationPrefix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      MigrationResolver[] getResolvers()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String[] getSchemas()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getSqlMigrationPrefix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getSqlMigrationSeparator()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getSqlMigrationSuffix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String[] getSqlMigrationSuffixes()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getTable()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      MigrationVersion getTarget()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      String getUndoSqlMigrationPrefix()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      MigrationInfoService info()
      Retrieves the complete information about all the migrations including applied, pending and current migrations with details and status.
      boolean isBaselineOnMigrate()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isBatch()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isCleanDisabled()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isCleanOnValidationError()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isGroup()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isIgnoreFutureMigrations()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isIgnoreIgnoredMigrations()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isIgnoreMissingMigrations()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isIgnorePendingMigrations()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isMixed()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isOracleSqlplus()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isOutOfOrder()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isPlaceholderReplacement()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isSkipDefaultCallbacks()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isSkipDefaultResolvers()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isStream()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      boolean isValidateOnMigrate()
      Deprecated.
      Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0.
      int migrate()
      Starts the database migration.
      void repair()
      Repairs the Flyway schema history table.
      void setBaselineDescription​(String baselineDescription)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setBaselineOnMigrate​(boolean baselineOnMigrate)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setBaselineVersion​(MigrationVersion baselineVersion)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setBaselineVersionAsString​(String baselineVersion)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setBatch​(boolean batch)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setCallbacks​(Callback... callbacks)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setCallbacks​(FlywayCallback... callbacks)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setCallbacksAsClassNames​(String... callbacks)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setClassLoader​(ClassLoader classLoader)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setCleanDisabled​(boolean cleanDisabled)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setCleanOnValidationError​(boolean cleanOnValidationError)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setDataSource​(String url, String user, String password, String... initSqls)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setDataSource​(DataSource dataSource)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setDryRunOutput​(OutputStream dryRunOutput)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setDryRunOutputAsFile​(File dryRunOutput)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setDryRunOutputAsFileName​(String dryRunOutputFileName)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setEncoding​(String encoding)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setErrorHandlers​(ErrorHandler... errorHandlers)
      Deprecated.
      ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.
      void setErrorHandlersAsClassNames​(String... errorHandlerClassNames)
      Deprecated.
      ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.
      void setErrorOverrides​(String... errorOverrides)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setGroup​(boolean group)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setIgnoreFutureMigrations​(boolean ignoreFutureMigrations)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setIgnoreIgnoredMigrations​(boolean ignoreIgnoredMigrations)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setIgnoreMissingMigrations​(boolean ignoreMissingMigrations)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setInstalledBy​(String installedBy)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setLicenseKey​(String licenseKey)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setLocations​(String... locations)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setMixed​(boolean mixed)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setOracleSqlplus​(boolean oracleSqlplus)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setOutOfOrder​(boolean outOfOrder)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setPlaceholderPrefix​(String placeholderPrefix)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setPlaceholderReplacement​(boolean placeholderReplacement)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setPlaceholders​(Map<String,​String> placeholders)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setPlaceholderSuffix​(String placeholderSuffix)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setRepeatableSqlMigrationPrefix​(String repeatableSqlMigrationPrefix)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setResolvers​(MigrationResolver... resolvers)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setResolversAsClassNames​(String... resolvers)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSchemas​(String... schemas)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSkipDefaultCallbacks​(boolean skipDefaultCallbacks)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSkipDefaultResolvers​(boolean skipDefaultResolvers)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSqlMigrationPrefix​(String sqlMigrationPrefix)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSqlMigrationSeparator​(String sqlMigrationSeparator)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setSqlMigrationSuffix​(String sqlMigrationSuffix)
      Deprecated.
      sqlMigrationSuffix has been deprecated and will be removed in Flyway 6.0.0.
      void setSqlMigrationSuffixes​(String... sqlMigrationSuffixes)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setStream​(boolean stream)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setTable​(String table)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setTarget​(MigrationVersion target)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setTargetAsString​(String target)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setUndoSqlMigrationPrefix​(String undoSqlMigrationPrefix)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      void setValidateOnMigrate​(boolean validateOnMigrate)
      Deprecated.
      Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0.
      int undo()
      Undoes the most recently applied versioned migration.
      void validate()
      Validate applied migrations against resolved ones (on the filesystem or classpath) to detect accidental changes that may prevent the schema(s) from being recreated exactly.
    • Constructor Detail

      • Flyway

        @Deprecated
        public Flyway()
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Creates a new instance of Flyway. This is your starting point.
      • Flyway

        @Deprecated
        public Flyway​(ClassLoader classLoader)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Creates a new instance of Flyway. This is your starting point.
        Parameters:
        classLoader - The ClassLoader to use for loading migrations, resolvers, etc from the classpath. (default: Thread.currentThread().getContextClassLoader() )
      • Flyway

        @Deprecated
        public Flyway​(FlywayConfiguration configuration)
        Deprecated.
        Use Flyway(Configuration) instead. Will be removed in Flyway 6.0.
        Creates a new instance of Flyway with this configuration.
        Parameters:
        configuration - The configuration to use.
      • Flyway

        public Flyway​(Configuration configuration)
        Creates a new instance of Flyway with this configuration. In general the Flyway.configure() factory method should be preferred over this constructor, unless you need to create or reuse separate Configuration objects.
        Parameters:
        configuration - The configuration to use.
    • Method Detail

      • configure

        public static FluentConfiguration configure()
        This is your starting point. This creates a configuration which can be customized to your needs before being loaded into a new Flyway instance using the load() method.

        In its simplest form, this is how you configure Flyway with all defaults to get started:

        Flyway flyway = Flyway.configure().dataSource(url, user, password).load();

        After that you have a fully-configured Flyway instance at your disposal which can be used to invoke Flyway functionality such as migrate() or clean().

        Returns:
        A new configuration from which Flyway can be loaded.
      • configure

        public static FluentConfiguration configure​(ClassLoader classLoader)
        This is your starting point. This creates a configuration which can be customized to your needs before being loaded into a new Flyway instance using the load() method.

        In its simplest form, this is how you configure Flyway with all defaults to get started:

        Flyway flyway = Flyway.configure().dataSource(url, user, password).load();

        After that you have a fully-configured Flyway instance at your disposal which can be used to invoke Flyway functionality such as migrate() or clean().

        Parameters:
        classLoader - The class loader to use when loading classes and resources.
        Returns:
        A new configuration from which Flyway can be loaded.
      • getConfiguration

        public Configuration getConfiguration()
        Returns:
        The configuration that Flyway is using.
      • getLocations

        @Deprecated
        public Location[] getLocations()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the locations to scan recursively for migrations.

        The location type is determined by its prefix. Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both SQL and Java-based migrations. Locations starting with filesystem: point to a directory on the filesystem, may only contain SQL migrations and are only scanned recursively down non-hidden directories.

        Specified by:
        getLocations in interface Configuration
        Returns:
        Locations to scan recursively for migrations. (default: classpath:db/migration)
      • getEncoding

        @Deprecated
        public Charset getEncoding()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the encoding of Sql migrations.
        Specified by:
        getEncoding in interface Configuration
        Returns:
        The encoding of Sql migrations. (default: UTF-8)
      • getSchemas

        @Deprecated
        public String[] getSchemas()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the schemas managed by Flyway. These schema names are case-sensitive.

        Consequences:

        • Flyway will automatically attempt to create all these schemas, unless the first one already exists.
        • The first schema in the list will be automatically set as the default one during the migration.
        • The first schema in the list will also be the one containing the schema history table.
        • The schemas will be cleaned in the order of this list.
        • If Flyway created them, the schemas themselves will as be dropped when cleaning.
        Specified by:
        getSchemas in interface Configuration
        Returns:
        The schemas managed by Flyway. (default: The default schema for the database connection)
      • getTable

        @Deprecated
        public String getTable()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration

        Retrieves the name of the schema schema history table that will be used by Flyway.

        By default (single-schema mode) the schema history table is placed in the default schema for the connection provided by the datasource.

        When the flyway.schemas property is set (multi-schema mode), the schema history table is placed in the first schema of the list.

        Specified by:
        getTable in interface Configuration
        Returns:
        The name of the schema schema history table that will be used by flyway. (default: flyway_schema_history)
      • getTarget

        @Deprecated
        public MigrationVersion getTarget()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. The special value current designates the current version of the schema.
        Specified by:
        getTarget in interface Configuration
        Returns:
        The target version up to which Flyway should consider migrations. (default: the latest version)
      • isPlaceholderReplacement

        @Deprecated
        public boolean isPlaceholderReplacement()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Checks whether placeholders should be replaced.
        Specified by:
        isPlaceholderReplacement in interface Configuration
        Returns:
        Whether placeholders should be replaced. (default: true)
      • getPlaceholders

        @Deprecated
        public Map<String,​String> getPlaceholders()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the map of <placeholder, replacementValue> to apply to sql migration scripts.
        Specified by:
        getPlaceholders in interface Configuration
        Returns:
        The map of <placeholder, replacementValue> to apply to sql migration scripts.
      • getPlaceholderPrefix

        @Deprecated
        public String getPlaceholderPrefix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the prefix of every placeholder.
        Specified by:
        getPlaceholderPrefix in interface Configuration
        Returns:
        The prefix of every placeholder. (default: ${ )
      • getPlaceholderSuffix

        @Deprecated
        public String getPlaceholderSuffix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the suffix of every placeholder.
        Specified by:
        getPlaceholderSuffix in interface Configuration
        Returns:
        The suffix of every placeholder. (default: } )
      • getSqlMigrationPrefix

        @Deprecated
        public String getSqlMigrationPrefix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The file name prefix for versioned SQL migrations.

        Versioned SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1.1__My_description.sql

        Specified by:
        getSqlMigrationPrefix in interface Configuration
        Returns:
        The file name prefix for sql migrations. (default: V)
      • getRepeatableSqlMigrationPrefix

        @Deprecated
        public String getRepeatableSqlMigrationPrefix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the file name prefix for repeatable SQL migrations.

        Repeatable SQL migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix , which using the defaults translates to R__My_description.sql

        Specified by:
        getRepeatableSqlMigrationPrefix in interface Configuration
        Returns:
        The file name prefix for repeatable sql migrations. (default: R)
      • getSqlMigrationSeparator

        @Deprecated
        public String getSqlMigrationSeparator()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the file name separator for sql migrations.

        Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Specified by:
        getSqlMigrationSeparator in interface Configuration
        Returns:
        The file name separator for sql migrations. (default: __)
      • getSqlMigrationSuffix

        @Deprecated
        public String getSqlMigrationSuffix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
      • getSqlMigrationSuffixes

        @Deprecated
        public String[] getSqlMigrationSuffixes()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The file name suffixes for SQL migrations. (default: .sql)

        SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Multiple suffixes (like .sql,.pkg,.pkb) can be specified for easier compatibility with other tools such as editors with specific file associations.

        Specified by:
        getSqlMigrationSuffixes in interface Configuration
        Returns:
        The file name suffixes for SQL migrations.
      • isIgnoreMissingMigrations

        @Deprecated
        public boolean isIgnoreMissingMigrations()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Ignore missing migrations when reading the schema history table. These are migrations that were performed by an older deployment of the application that are no longer available in this version. For example: we have migrations available on the classpath with versions 1.0 and 3.0. The schema history table indicates that a migration with version 2.0 (unknown to us) has also been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to deploy a newer version of the application even though it doesn't contain migrations included with an older one anymore. Note that if the most recently applied migration is removed, Flyway has no way to know it is missing and will mark it as future instead.
        Specified by:
        isIgnoreMissingMigrations in interface Configuration
        Returns:
        true to continue normally and log a warning, false to fail fast with an exception. (default: false)
      • isIgnoreIgnoredMigrations

        @Deprecated
        public boolean isIgnoreIgnoredMigrations()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Ignore ignored migrations when reading the schema history table. These are migrations that were added in between already migrated migrations in this version. For example: we have migrations available on the classpath with versions from 1.0 to 3.0. The schema history table indicates that version 1 was finished on 1.0.15, and the next one was 2.0.0. But with the next release a new migration was added to version 1: 1.0.16. Such scenario is ignored by migrate command, but by default is rejected by validate. When ignoreIgnoredMigrations is enabled, such case will not be reported by validate command. This is useful for situations where one must be able to deliver complete set of migrations in a delivery package for multiple versions of the product, and allows for further development of older versions.
        Specified by:
        isIgnoreIgnoredMigrations in interface Configuration
        Returns:
        true to continue normally, false to fail fast with an exception. (default: false)
      • isIgnorePendingMigrations

        @Deprecated
        public boolean isIgnorePendingMigrations()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Ignore pending migrations when reading the schema history table. These are migrations that are available but have not yet been applied. This can be useful for verifying that in-development migration changes don't contain any validation-breaking changes of migrations that have already been applied to a production environment, e.g. as part of a CI/CD process, without failing because of the existence of new migration versions.
        Specified by:
        isIgnorePendingMigrations in interface Configuration
        Returns:
        true to continue normally, false to fail fast with an exception. (default: false)
      • isIgnoreFutureMigrations

        @Deprecated
        public boolean isIgnoreFutureMigrations()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Ignore future migrations when reading the schema history table. These are migrations that were performed by a newer deployment of the application that are not yet available in this version. For example: we have migrations available on the classpath up to version 3.0. The schema history table indicates that a migration to version 4.0 (unknown to us) has already been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to redeploy an older version of the application after the database has been migrated by a newer one.
        Specified by:
        isIgnoreFutureMigrations in interface Configuration
        Returns:
        true to continue normally and log a warning, false to fail fast with an exception. (default: true)
      • isValidateOnMigrate

        @Deprecated
        public boolean isValidateOnMigrate()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to automatically call validate or not when running migrate.
        Specified by:
        isValidateOnMigrate in interface Configuration
        Returns:
        true if validate should be called. false if not. (default: true)
      • isCleanOnValidationError

        @Deprecated
        public boolean isCleanOnValidationError()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to automatically call clean or not when a validation error occurs.

        This is exclusively intended as a convenience for development. Even tough we strongly recommend not to change migration scripts once they have been checked into SCM and run, this provides a way of dealing with this case in a smooth manner. The database will be wiped clean automatically, ensuring that the next migration will bring you back to the state checked into SCM.

        Warning ! Do not enable in production !

        Specified by:
        isCleanOnValidationError in interface Configuration
        Returns:
        true if clean should be called. false if not. (default: false)
      • isCleanDisabled

        @Deprecated
        public boolean isCleanDisabled()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to disable clean.

        This is especially useful for production environments where running clean can be quite a career limiting move.

        Specified by:
        isCleanDisabled in interface Configuration
        Returns:
        true to disabled clean. false to leave it enabled. (default: false)
      • getBaselineVersion

        @Deprecated
        public MigrationVersion getBaselineVersion()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the version to tag an existing schema with when executing baseline.
        Specified by:
        getBaselineVersion in interface Configuration
        Returns:
        The version to tag an existing schema with when executing baseline. (default: 1)
      • getBaselineDescription

        @Deprecated
        public String getBaselineDescription()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the description to tag an existing schema with when executing baseline.
        Specified by:
        getBaselineDescription in interface Configuration
        Returns:
        The description to tag an existing schema with when executing baseline. (default: << Flyway Baseline >>)
      • isBaselineOnMigrate

        @Deprecated
        public boolean isBaselineOnMigrate()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration

        Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table. This schema will then be initialized with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied.

        This is useful for initial Flyway production deployments on projects with an existing DB.

        Be careful when enabling this as it removes the safety net that ensures Flyway does not migrate the wrong database in case of a configuration mistake!

        Specified by:
        isBaselineOnMigrate in interface Configuration
        Returns:
        true if baseline should be called on migrate for non-empty schemas, false if not. (default: false)
      • isOutOfOrder

        @Deprecated
        public boolean isOutOfOrder()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Allows migrations to be run "out of order".

        If you already have versions 1 and 3 applied, and now a version 2 is found, it will be applied too instead of being ignored.

        Specified by:
        isOutOfOrder in interface Configuration
        Returns:
        true if outOfOrder migrations should be applied, false if not. (default: false)
      • getResolvers

        @Deprecated
        public MigrationResolver[] getResolvers()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.
        Specified by:
        getResolvers in interface Configuration
        Returns:
        The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. An empty array if none. (default: none)
      • isSkipDefaultResolvers

        @Deprecated
        public boolean isSkipDefaultResolvers()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether Flyway should skip the default resolvers. If true, only custom resolvers are used.
        Specified by:
        isSkipDefaultResolvers in interface Configuration
        Returns:
        Whether default built-in resolvers should be skipped. (default: false)
      • getDataSource

        @Deprecated
        public DataSource getDataSource()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the dataSource to use to access the database. Must have the necessary privileges to execute ddl.
        Specified by:
        getDataSource in interface Configuration
        Returns:
        The dataSource to use to access the database. Must have the necessary privileges to execute ddl.
      • getConnectRetries

        @Deprecated
        public int getConnectRetries()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The maximum number of retries when attempting to connect to the database. After each failed attempt, Flyway will wait 1 second before attempting to connect again, up to the maximum number of times specified by connectRetries.
        Specified by:
        getConnectRetries in interface Configuration
        Returns:
        The maximum number of retries when attempting to connect to the database. (default: 0)
      • getInitSql

        @Deprecated
        public String getInitSql()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The SQL statements to run to initialize a new database connection immediately after opening it.
        Specified by:
        getInitSql in interface Configuration
        Returns:
        The SQL statements. (default: null)
      • getClassLoader

        @Deprecated
        public ClassLoader getClassLoader()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Retrieves the ClassLoader to use for loading migrations, resolvers, etc from the classpath.
        Specified by:
        getClassLoader in interface Configuration
        Returns:
        The ClassLoader to use for loading migrations, resolvers, etc from the classpath. (default: Thread.currentThread().getContextClassLoader() )
      • isMixed

        @Deprecated
        public boolean isMixed()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to allow mixing transactional and non-transactional statements within the same migration.
        Specified by:
        isMixed in interface Configuration
        Returns:
        true if mixed migrations should be allowed. false if an error should be thrown instead. (default: false)
      • getInstalledBy

        @Deprecated
        public String getInstalledBy()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The username that will be recorded in the schema history table as having applied the migration.
        Specified by:
        getInstalledBy in interface Configuration
        Returns:
        The username or null for the current database user of the connection. (default: null).
      • isGroup

        @Deprecated
        public boolean isGroup()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).
        Specified by:
        isGroup in interface Configuration
        Returns:
        true if migrations should be grouped. false if they should be applied individually instead. (default: false)
      • getErrorHandlers

        @Deprecated
        public ErrorHandler[] getErrorHandlers()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Handlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        getErrorHandlers in interface Configuration
        Returns:
        The ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
      • getErrorOverrides

        @Deprecated
        public String[] getErrorOverrides()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.

        Each error override has the following format: STATE:12345:W. It is a 5 character SQL state, a colon, the SQL error code, a colon and finally the desired behavior that should override the initial one.

        The following behaviors are accepted:

        • D to force a debug message
        • D- to force a debug message, but do not show the original sql state and error code
        • I to force an info message
        • I- to force an info message, but do not show the original sql state and error code
        • W to force a warning
        • W- to force a warning, but do not show the original sql state and error code
        • E to force an error
        • E- to force an error, but do not show the original sql state and error code

        Example 1: to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used: 99999:17110:E

        Example 2: to force SQL Server PRINT messages to be displayed as info messages (without SQL state and error code details) instead of warnings, the following errorOverride can be used: S0001:0:I-

        Flyway Pro and Flyway Enterprise only

        Specified by:
        getErrorOverrides in interface Configuration
        Returns:
        The ErrorOverrides or an empty array if none are defined. (default: none)
      • getDryRunOutput

        @Deprecated
        public OutputStream getDryRunOutput()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The stream where to output the SQL statements of a migration dry run. null if the SQL statements are executed against the database directly.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        getDryRunOutput in interface Configuration
        Returns:
        The stream or null if the SQL statements are executed against the database directly.
      • isStream

        @Deprecated
        public boolean isStream()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to stream SQL migrations when executing them. Streaming doesn't load the entire migration in memory at once. Instead each statement is loaded individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this dramatically reduces Flyway's memory consumption.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        isStream in interface Configuration
        Returns:
        true to stream SQL migrations. false to fully loaded them in memory instead. (default: false)
      • isBatch

        @Deprecated
        public boolean isBatch()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to batch SQL statements when executing them. Batching can save up to 99 percent of network roundtrips by sending up to 100 statements at once over the network to the database, instead of sending each statement individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this can dramatically reduce the network overhead. This is supported for INSERT, UPDATE, DELETE, MERGE and UPSERT statements. All other statements are automatically executed without batching.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        isBatch in interface Configuration
        Returns:
        true to batch SQL statements. false to execute them individually instead. (default: false)
      • isOracleSqlplus

        @Deprecated
        public boolean isOracleSqlplus()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether to Flyway's support for Oracle SQL*Plus commands should be activated.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        isOracleSqlplus in interface Configuration
        Returns:
        true to active SQL*Plus support. false to fail fast instead. (default: false)
      • getLicenseKey

        @Deprecated
        public String getLicenseKey()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Flyway's license key.

        Flyway Pro and Flyway Enterprise only

        Specified by:
        getLicenseKey in interface Configuration
        Returns:
        The license key.
      • setDryRunOutput

        @Deprecated
        public void setDryRunOutput​(OutputStream dryRunOutput)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the stream where to output the SQL statements of a migration dry run. null to execute the SQL statements directly against the database. The stream when be closing when Flyway finishes writing the output.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        dryRunOutput - The output file or null to execute the SQL statements directly against the database.
      • setDryRunOutputAsFile

        @Deprecated
        public void setDryRunOutputAsFile​(File dryRunOutput)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file where to output the SQL statements of a migration dry run. null to execute the SQL statements directly against the database. If the file specified is in a non-existent directory, Flyway will create all directories and parent directories as needed.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        dryRunOutput - The output file or null to execute the SQL statements directly against the database.
      • setDryRunOutputAsFileName

        @Deprecated
        public void setDryRunOutputAsFileName​(String dryRunOutputFileName)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file where to output the SQL statements of a migration dry run. null to execute the SQL statements directly against the database. If the file specified is in a non-existent directory, Flyway will create all directories and parent directories as needed.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        dryRunOutputFileName - The name of the output file or null to execute the SQL statements directly against the database.
      • setErrorHandlers

        @Deprecated
        public void setErrorHandlers​(ErrorHandler... errorHandlers)
        Deprecated.
        ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.
        Handlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        errorHandlers - The ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
      • setErrorHandlersAsClassNames

        @Deprecated
        public void setErrorHandlersAsClassNames​(String... errorHandlerClassNames)
        Deprecated.
        ErrorHandlers have been deprecated and will be removed in Flyway 6.0 use statement-level callbacks instead.
        Handlers for errors and warnings that occur during a migration. This can be used to customize Flyway's behavior by for example throwing another runtime exception, outputting a warning or suppressing the error instead of throwing a FlywayException. ErrorHandlers are invoked in order until one reports to have successfully handled the errors or warnings. If none do, or if none are present, Flyway falls back to its default handling of errors and warnings.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        errorHandlerClassNames - The fully qualified class names of ErrorHandlers or an empty array if the default internal handler should be used instead. (default: none)
      • setErrorOverrides

        @Deprecated
        public void setErrorOverrides​(String... errorOverrides)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Rules for the built-in error handler that let you override specific SQL states and errors codes in order to force specific errors or warnings to be treated as debug messages, info messages, warnings or errors.

        Each error override has the following format: STATE:12345:W. It is a 5 character SQL state, a colon, the SQL error code, a colon and finally the desired behavior that should override the initial one.

        The following behaviors are accepted:

        • D to force a debug message
        • D- to force a debug message, but do not show the original sql state and error code
        • I to force an info message
        • I- to force an info message, but do not show the original sql state and error code
        • W to force a warning
        • W- to force a warning, but do not show the original sql state and error code
        • E to force an error
        • E- to force an error, but do not show the original sql state and error code

        Example 1: to force Oracle stored procedure compilation issues to produce errors instead of warnings, the following errorOverride can be used: 99999:17110:E

        Example 2: to force SQL Server PRINT messages to be displayed as info messages (without SQL state and error code details) instead of warnings, the following errorOverride can be used: S0001:0:I-

        Flyway Pro and Flyway Enterprise only

        Parameters:
        errorOverrides - The ErrorOverrides or an empty array if none are defined. (default: none)
      • setGroup

        @Deprecated
        public void setGroup​(boolean group)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions).
        Parameters:
        group - true if migrations should be grouped. false if they should be applied individually instead. (default: false)
      • setInstalledBy

        @Deprecated
        public void setInstalledBy​(String installedBy)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        The username that will be recorded in the schema history table as having applied the migration.
        Parameters:
        installedBy - The username or null for the current database user of the connection. (default: null).
      • setMixed

        @Deprecated
        public void setMixed​(boolean mixed)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to allow mixing transactional and non-transactional statements within the same migration.
        Parameters:
        mixed - true if mixed migrations should be allowed. false if an error should be thrown instead. (default: false)
      • setIgnoreMissingMigrations

        @Deprecated
        public void setIgnoreMissingMigrations​(boolean ignoreMissingMigrations)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Ignore missing migrations when reading the schema history table. These are migrations that were performed by an older deployment of the application that are no longer available in this version. For example: we have migrations available on the classpath with versions 1.0 and 3.0. The schema history table indicates that a migration with version 2.0 (unknown to us) has also been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to deploy a newer version of the application even though it doesn't contain migrations included with an older one anymore. Note that if the most recently applied migration is removed, Flyway has no way to know it is missing and will mark it as future instead.
        Parameters:
        ignoreMissingMigrations - true to continue normally and log a warning, false to fail fast with an exception. (default: false)
      • setIgnoreIgnoredMigrations

        @Deprecated
        public void setIgnoreIgnoredMigrations​(boolean ignoreIgnoredMigrations)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Ignore ignored migrations when reading the schema history table. These are migrations that were added in between already migrated migrations in this version. For example: we have migrations available on the classpath with versions from 1.0 to 3.0. The schema history table indicates that version 1 was finished on 1.0.15, and the next one was 2.0.0. But with the next release a new migration was added to version 1: 1.0.16. Such scenario is ignored by migrate command, but by default is rejected by validate. When ignoreIgnoredMigrations is enabled, such case will not be reported by validate command. This is useful for situations where one must be able to deliver complete set of migrations in a delivery package for multiple versions of the product, and allows for further development of older versions.
        Parameters:
        ignoreIgnoredMigrations - true to continue normally, false to fail fast with an exception. (default: false)
      • setIgnoreFutureMigrations

        @Deprecated
        public void setIgnoreFutureMigrations​(boolean ignoreFutureMigrations)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to ignore future migrations when reading the schema history table. These are migrations that were performed by a newer deployment of the application that are not yet available in this version. For example: we have migrations available on the classpath up to version 3.0. The schema history table indicates that a migration to version 4.0 (unknown to us) has already been applied. Instead of bombing out (fail fast) with an exception, a warning is logged and Flyway continues normally. This is useful for situations where one must be able to redeploy an older version of the application after the database has been migrated by a newer one.
        Parameters:
        ignoreFutureMigrations - true to continue normally and log a warning, false to fail fast with an exception. (default: true)
      • setValidateOnMigrate

        @Deprecated
        public void setValidateOnMigrate​(boolean validateOnMigrate)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to automatically call validate or not when running migrate.
        Parameters:
        validateOnMigrate - true if validate should be called. false if not. (default: true)
      • setCleanOnValidationError

        @Deprecated
        public void setCleanOnValidationError​(boolean cleanOnValidationError)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to automatically call clean or not when a validation error occurs.

        This is exclusively intended as a convenience for development. Even tough we strongly recommend not to change migration scripts once they have been checked into SCM and run, this provides a way of dealing with this case in a smooth manner. The database will be wiped clean automatically, ensuring that the next migration will bring you back to the state checked into SCM.

        Warning ! Do not enable in production !

        Parameters:
        cleanOnValidationError - true if clean should be called. false if not. (default: false)
      • setCleanDisabled

        @Deprecated
        public void setCleanDisabled​(boolean cleanDisabled)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to disable clean.

        This is especially useful for production environments where running clean can be quite a career limiting move.

        Parameters:
        cleanDisabled - true to disabled clean. false to leave it enabled. (default: false)
      • setLocations

        @Deprecated
        public void setLocations​(String... locations)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the locations to scan recursively for migrations.

        The location type is determined by its prefix. Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both sql and java-based migrations. Locations starting with filesystem: point to a directory on the filesystem and may only contain sql migrations.

        Parameters:
        locations - Locations to scan recursively for migrations. (default: db/migration)
      • setEncoding

        @Deprecated
        public void setEncoding​(String encoding)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the encoding of Sql migrations.
        Parameters:
        encoding - The encoding of Sql migrations. (default: UTF-8)
      • setSchemas

        @Deprecated
        public void setSchemas​(String... schemas)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the schemas managed by Flyway. These schema names are case-sensitive. (default: The default schema for the database connection)

        Consequences:

        • Flyway will automatically attempt to create all these schemas, unless the first one already exists.
        • The first schema in the list will be automatically set as the default one during the migration.
        • The first schema in the list will also be the one containing the schema history table.
        • The schemas will be cleaned in the order of this list.
        • If Flyway created them, the schemas themselves will as be dropped when cleaning.
        Parameters:
        schemas - The schemas managed by Flyway. May not be null. Must contain at least one element.
      • setTable

        @Deprecated
        public void setTable​(String table)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.

        Sets the name of the schema schema history table that will be used by Flyway.

        By default (single-schema mode) the schema history table is placed in the default schema for the connection provided by the datasource.

        When the flyway.schemas property is set (multi-schema mode), the schema history table is placed in the first schema of the list.

        Parameters:
        table - The name of the schema schema history table that will be used by flyway. (default: flyway_schema_history)
      • setTarget

        @Deprecated
        public void setTarget​(MigrationVersion target)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored.
        Parameters:
        target - The target version up to which Flyway should consider migrations. (default: the latest version)
      • setTargetAsString

        @Deprecated
        public void setTargetAsString​(String target)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored.
        Parameters:
        target - The target version up to which Flyway should consider migrations. The special value current designates the current version of the schema. (default: the latest version)
      • setPlaceholderReplacement

        @Deprecated
        public void setPlaceholderReplacement​(boolean placeholderReplacement)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets whether placeholders should be replaced.
        Parameters:
        placeholderReplacement - Whether placeholders should be replaced. (default: true)
      • setPlaceholders

        @Deprecated
        public void setPlaceholders​(Map<String,​String> placeholders)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the placeholders to replace in sql migration scripts.
        Parameters:
        placeholders - The map of <placeholder, replacementValue> to apply to sql migration scripts.
      • setPlaceholderPrefix

        @Deprecated
        public void setPlaceholderPrefix​(String placeholderPrefix)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the prefix of every placeholder.
        Parameters:
        placeholderPrefix - The prefix of every placeholder. (default: ${ )
      • setPlaceholderSuffix

        @Deprecated
        public void setPlaceholderSuffix​(String placeholderSuffix)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the suffix of every placeholder.
        Parameters:
        placeholderSuffix - The suffix of every placeholder. (default: } )
      • setSqlMigrationPrefix

        @Deprecated
        public void setSqlMigrationPrefix​(String sqlMigrationPrefix)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file name prefix for sql migrations.

        Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Parameters:
        sqlMigrationPrefix - The file name prefix for sql migrations (default: V)
      • getUndoSqlMigrationPrefix

        @Deprecated
        public String getUndoSqlMigrationPrefix()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        The file name prefix for undo SQL migrations.

        Undo SQL migrations are responsible for undoing the effects of the versioned migration with the same version.

        They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to U1.1__My_description.sql

        Flyway Pro and Flyway Enterprise only

        Specified by:
        getUndoSqlMigrationPrefix in interface Configuration
        Returns:
        The file name prefix for undo sql migrations. (default: U)
      • setUndoSqlMigrationPrefix

        @Deprecated
        public void setUndoSqlMigrationPrefix​(String undoSqlMigrationPrefix)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file name prefix for undo SQL migrations. (default: U)

        Undo SQL migrations are responsible for undoing the effects of the versioned migration with the same version.

        They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to U1.1__My_description.sql

        Flyway Pro and Flyway Enterprise only

        Parameters:
        undoSqlMigrationPrefix - The file name prefix for undo SQL migrations. (default: U)
      • setRepeatableSqlMigrationPrefix

        @Deprecated
        public void setRepeatableSqlMigrationPrefix​(String repeatableSqlMigrationPrefix)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file name prefix for repeatable sql migrations.

        Repeatable sql migrations have the following file name structure: prefixSeparatorDESCRIPTIONsuffix , which using the defaults translates to R__My_description.sql

        Parameters:
        repeatableSqlMigrationPrefix - The file name prefix for repeatable sql migrations (default: R)
      • setSqlMigrationSeparator

        @Deprecated
        public void setSqlMigrationSeparator​(String sqlMigrationSeparator)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the file name separator for sql migrations.

        Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Parameters:
        sqlMigrationSeparator - The file name separator for sql migrations (default: __)
      • setSqlMigrationSuffix

        @Deprecated
        public void setSqlMigrationSuffix​(String sqlMigrationSuffix)
        Deprecated.
        sqlMigrationSuffix has been deprecated and will be removed in Flyway 6.0.0. Use sqlMigrationSuffixes instead.
        Sets the file name suffix for sql migrations.

        Sql migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Parameters:
        sqlMigrationSuffix - The file name suffix for sql migrations (default: .sql)
      • setSqlMigrationSuffixes

        @Deprecated
        public void setSqlMigrationSuffixes​(String... sqlMigrationSuffixes)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        The file name suffixes for SQL migrations. (default: .sql)

        SQL migrations have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix , which using the defaults translates to V1_1__My_description.sql

        Multiple suffixes (like .sql,.pkg,.pkb) can be specified for easier compatibility with other tools such as editors with specific file associations.

        Parameters:
        sqlMigrationSuffixes - The file name suffixes for SQL migrations.
      • setDataSource

        @Deprecated
        public void setDataSource​(DataSource dataSource)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the datasource to use. Must have the necessary privileges to execute ddl.
        Parameters:
        dataSource - The datasource to use. Must have the necessary privileges to execute ddl.
      • setDataSource

        @Deprecated
        public void setDataSource​(String url,
                                  String user,
                                  String password,
                                  String... initSqls)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the datasource to use. Must have the necessary privileges to execute ddl.

        To use a custom ClassLoader, setClassLoader() must be called prior to calling this method.

        Parameters:
        url - The JDBC URL of the database.
        user - The user of the database.
        password - The password of the database.
        initSqls - The (optional) sql statements to execute to initialize a connection immediately after obtaining it.
      • setClassLoader

        @Deprecated
        public void setClassLoader​(ClassLoader classLoader)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure(ClassLoader) instead.
        Sets the ClassLoader to use for resolving migrations on the classpath.
        Parameters:
        classLoader - The ClassLoader to use for loading migrations, resolvers, etc from the classpath. (default: Thread.currentThread().getContextClassLoader() )
      • setBaselineVersion

        @Deprecated
        public void setBaselineVersion​(MigrationVersion baselineVersion)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the version to tag an existing schema with when executing baseline.
        Parameters:
        baselineVersion - The version to tag an existing schema with when executing baseline. (default: 1)
      • setBaselineVersionAsString

        @Deprecated
        public void setBaselineVersionAsString​(String baselineVersion)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the version to tag an existing schema with when executing baseline.
        Parameters:
        baselineVersion - The version to tag an existing schema with when executing baseline. (default: 1)
      • setBaselineDescription

        @Deprecated
        public void setBaselineDescription​(String baselineDescription)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets the description to tag an existing schema with when executing baseline.
        Parameters:
        baselineDescription - The description to tag an existing schema with when executing baseline. (default: << Flyway Baseline >>)
      • setBaselineOnMigrate

        @Deprecated
        public void setBaselineOnMigrate​(boolean baselineOnMigrate)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.

        Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table. This schema will then be baselined with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied.

        This is useful for initial Flyway production deployments on projects with an existing DB.

        Be careful when enabling this as it removes the safety net that ensures Flyway does not migrate the wrong database in case of a configuration mistake!

        Parameters:
        baselineOnMigrate - true if baseline should be called on migrate for non-empty schemas, false if not. (default: false)
      • setOutOfOrder

        @Deprecated
        public void setOutOfOrder​(boolean outOfOrder)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Allows migrations to be run "out of order".

        If you already have versions 1 and 3 applied, and now a version 2 is found, it will be applied too instead of being ignored.

        Parameters:
        outOfOrder - true if outOfOrder migrations should be applied, false if not. (default: false)
      • getCallbacks

        @Deprecated
        public Callback[] getCallbacks()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Gets the callbacks for lifecycle notifications.
        Specified by:
        getCallbacks in interface Configuration
        Returns:
        The callbacks for lifecycle notifications. An empty array if none. (default: none)
      • isSkipDefaultCallbacks

        @Deprecated
        public boolean isSkipDefaultCallbacks()
        Deprecated.
        Direct configuration retrieval from the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.getConfiguration() instead.
        Description copied from interface: Configuration
        Whether Flyway should skip the default callbacks. If true, only custom callbacks are used.
        Specified by:
        isSkipDefaultCallbacks in interface Configuration
        Returns:
        Whether default built-in callbacks should be skipped. (default: false)
      • setCallbacks

        @Deprecated
        public void setCallbacks​(Callback... callbacks)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Set the callbacks for lifecycle notifications.
        Parameters:
        callbacks - The callbacks for lifecycle notifications. (default: none)
      • setCallbacks

        @Deprecated
        public void setCallbacks​(FlywayCallback... callbacks)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Set the callbacks for lifecycle notifications.
        Parameters:
        callbacks - The callbacks for lifecycle notifications. (default: none)
      • setCallbacksAsClassNames

        @Deprecated
        public void setCallbacksAsClassNames​(String... callbacks)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Set the callbacks for lifecycle notifications.
        Parameters:
        callbacks - The fully qualified class names of the callbacks for lifecycle notifications. (default: none)
      • setSkipDefaultCallbacks

        @Deprecated
        public void setSkipDefaultCallbacks​(boolean skipDefaultCallbacks)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether Flyway should skip the default callbacks. If true, only custom callbacks are used.
        Parameters:
        skipDefaultCallbacks - Whether default built-in callbacks should be skipped.

        (default: false)

      • setResolvers

        @Deprecated
        public void setResolvers​(MigrationResolver... resolvers)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.
        Parameters:
        resolvers - The custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. (default: empty list)
      • setResolversAsClassNames

        @Deprecated
        public void setResolversAsClassNames​(String... resolvers)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Sets custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply.
        Parameters:
        resolvers - The fully qualified class names of the custom MigrationResolvers to be used in addition to the built-in ones for resolving Migrations to apply. (default: empty list)
      • setSkipDefaultResolvers

        @Deprecated
        public void setSkipDefaultResolvers​(boolean skipDefaultResolvers)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether Flyway should skip the default resolvers. If true, only custom resolvers are used.
        Parameters:
        skipDefaultResolvers - Whether default built-in resolvers should be skipped.

        (default: false)

      • setStream

        @Deprecated
        public void setStream​(boolean stream)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to stream SQL migrations when executing them. Streaming doesn't load the entire migration in memory at once. Instead each statement is loaded individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this dramatically reduces Flyway's memory consumption.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        stream - true to stream SQL migrations. false to fully loaded them in memory instead. (default: false)
      • setBatch

        @Deprecated
        public void setBatch​(boolean batch)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to batch SQL statements when executing them. Batching can save up to 99 percent of network roundtrips by sending up to 100 statements at once over the network to the database, instead of sending each statement individually. This is particularly useful for very large SQL migrations composed of multiple MB or even GB of reference data, as this can dramatically reduce the network overhead. This is supported for INSERT, UPDATE, DELETE, MERGE and UPSERT statements. All other statements are automatically executed without batching.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        batch - true to batch SQL statements. false to execute them individually instead. (default: false)
      • setOracleSqlplus

        @Deprecated
        public void setOracleSqlplus​(boolean oracleSqlplus)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Whether to Flyway's support for Oracle SQL*Plus commands should be activated.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        oracleSqlplus - true to active SQL*Plus support. false to fail fast instead. (default: false)
      • setLicenseKey

        @Deprecated
        public void setLicenseKey​(String licenseKey)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Flyway's license key.

        Flyway Pro and Flyway Enterprise only

        Parameters:
        licenseKey - The license key.
      • migrate

        public int migrate()
                    throws FlywayException

        Starts the database migration. All pending migrations will be applied in order. Calling migrate on an up-to-date database has no effect.

        migrate
        Returns:
        The number of successfully applied migrations.
        Throws:
        FlywayException - when the migration failed.
      • undo

        public int undo()
                 throws FlywayException

        Undoes the most recently applied versioned migration. If target is specified, Flyway will attempt to undo versioned migrations in the order they were applied until it hits one with a version below the target. If there is no versioned migration to undo, calling undo has no effect.

        Flyway Pro and Flyway Enterprise only

        undo
        Returns:
        The number of successfully undone migrations.
        Throws:
        FlywayException - when the undo failed.
      • validate

        public void validate()
                      throws FlywayException

        Validate applied migrations against resolved ones (on the filesystem or classpath) to detect accidental changes that may prevent the schema(s) from being recreated exactly.

        Validation fails if

        • differences in migration names, types or checksums are found
        • versions have been applied that aren't resolved locally anymore
        • versions have been resolved that haven't been applied yet
        validate
        Throws:
        FlywayException - when the validation failed.
      • clean

        public void clean()

        Drops all objects (tables, views, procedures, triggers, ...) in the configured schemas. The schemas are cleaned in the order specified by the schemas property.

        clean
        Throws:
        FlywayException - when the clean fails.
      • info

        public MigrationInfoService info()

        Retrieves the complete information about all the migrations including applied, pending and current migrations with details and status.

        info
        Returns:
        All migrations sorted by version, oldest first.
        Throws:
        FlywayException - when the info retrieval failed.
      • baseline

        public void baseline()
                      throws FlywayException

        Baselines an existing database, excluding all migrations up to and including baselineVersion.

        baseline
        Throws:
        FlywayException - when the schema baselining failed.
      • repair

        public void repair()
                    throws FlywayException
        Repairs the Flyway schema history table. This will perform the following actions:
        • Remove any failed migrations on databases without DDL transactions (User objects left behind must still be cleaned up manually)
        • Realign the checksums, descriptions and types of the applied migrations with the ones of the available migrations
        repair
        Throws:
        FlywayException - when the schema history table repair failed.
      • configure

        @Deprecated
        public void configure​(Properties properties)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.

        To use a custom ClassLoader, the Flyway(ClassLoader) constructor must be called prior to calling this method.

        Parameters:
        properties - Properties used for configuration.
        Throws:
        FlywayException - when the configuration failed.
      • configure

        @Deprecated
        public void configure​(Map<String,​String> props)
        Deprecated.
        Direct configuration of the Flyway object has been deprecated and will be removed in Flyway 6.0. Use Flyway.configure() instead.
        Configures Flyway with these properties. This overwrites any existing configuration. Property names are documented in the flyway maven plugin.

        To use a custom ClassLoader, it must be passed to the Flyway constructor prior to calling this method.

        Parameters:
        props - Properties used for configuration.
        Throws:
        FlywayException - when the configuration failed.