How can we help you today? How can we help you today?

Files in schema model having different extensions

For an Oracle database, I am exporting the DDL and saving the files into my schema-model.  Is it possible to use files with extension other than .sql (e.g. .prc for procedures, .trg for triggers, .pkg for packages, etc)?

Brian
1

Comments

2 comments

  • Jon Kirkwood
    Official comment

    Hi Brian 

    Thank you for reaching out on the Redgate forums with your Flyway extension inquiry. 

    Yes, this may be supported in Flyway for your requirements.

     

    By default, Flyway scans for .sql file types to read in for migrations.

    However, you can configure additional suffixes using the flyway.sqlMigrationSuffixes setting, for example:

    flyway.sqlMigrationSuffixes=.sql,.pkg,.pkb,.prc,.trg

    Documentation:
    https://documentation.red-gate.com/flyway/reference/configuration/flyway-namespace/flyway-sql-migration-suffixes-setting

     

    That said, while it’s possible, it does add complexity. 

    All environments (developers, CI, build agents) would need to use the same configuration, and it moves away from Flyway’s default conventions.

     

    Flyway determines object type from the SQL inside the file (not the extension), which means in most cases, keeping everything as .sql is the simpler and more maintainable approach.

     

    The sqlMigrationSuffixes setting is not maintained through Flyway Desktop. You would need to modify your configuration file directly. 

    Information on the expected layout of this field can be found on the link provided above.

     

    Hope this helps with your project and filetype naming.

    Jon Kirkwood
  • Brian

    Thanks for the reply, Jon.  I tried adding the sqlMigrationSuffixes setting to our .toml file (Flyway Desktop), however the objects for which the DDL files have different extensions still were not picked up in the schema model.  I will have to revert to prefixing the file names with the object types.  Some database tools (e.g. Toad for Oracle) save the files with different extensions to indicate the type of object being created. Even though the files are stored in separate folders in our repository, it's our preference to also have distinguishing naming conventions, and I was hoping to keep these extensions.

    Brian
    0

Add comment

Please sign in to leave a comment.