Oracle Schema Existence Checks are Now in Preview in Flyway Enterprise
When generating versioned and undo migration scripts for Oracle database projects, you can set a comparison option to include object existence checks in the generated SQL. When enabled, Flyway checks whether a table, column, view, or other object already exists before attempting to create or drop them.
Why this matters for Oracle
Oracle auto-commits DDL statements. That means if a versioned migration script contains multiple DDL changes and fails partway through, due to a network timeout or a locking issue for example, you end up with a partially applied state. Flyway records the failure in the flyway_schema_history table, but the objects already created by that script remain in the database.
Without existence checks, recovering from this situation usually means doing at least one of the following:
- Undoing the changes the script made or editing the script to make the already-executed parts idempotent or splitting the script into two: one marked as applied (covering what ran successfully) and a new one for the remaining changes.
- Running “flyway repair” to update the schema history so Flyway knows to attempt the script again.
That is a fair amount of manual work, particularly when the failure was caused by something like a transient timeout and nothing was actually wrong with the DDL commands.
What changes with existence checks enabled
When existence checks are included in the generated script, Flyway wraps each DDL statement with a conditional that checks whether the object already exists. If the script fails and you need to re-run it, the already-created objects are skipped rather than causing errors.
In timeout scenarios especially, recovery becomes much simpler:
- Run “flyway repair” to tell Flyway you want to attempt the script again.
- Run “flyway migrate” to re-run it against the target database.
This does not replace “flyway repair” in your recovery workflow. It removes the need for manual cleanup of partially applied state before you can use it.
How to enable it
Object existence checks are set as a comparison option when generating versioned or undo migration scripts for Oracle projects. Look for this option in Flyway Desktop when creating a new project or on the Schema Model page for existing projects. This option can also be set in the CLI or TOML configuration when targeting an Oracle database.

Public Preview
This feature is currently available in Public Preview. We would love to hear how it works in practice for you, and whether there is anything else we should address before the full release. Feedback from real migration workflows is exactly what helps us get this right.
This document contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved






Loading comments...