Steve-B
Steve-B

Reputation: 668

Possibility of flyway custom clean script

Our Oracle database uses the "Text data dictionary" Module. Part of the set-up creates a preference.

    -- create preference...
    begin
          ctx_ddl.create_preference(....);
      ctx_ddl.set_attribute(...);
    end;

The problem is that the flyway clean goal does not drop this preference.

So, my question: is it possible to add/configure an extra clean-up script to remove non-table/index/view objects? Or is there any other way to achieving this?

EDIT: I've just realised the same goes for jobs in the scheduler. They are also not deleted by the flyway clean. For example:

      sys.dbms_scheduler.create_job(
      job_name => 'MY_JOB',
      job_type => 'plsql_block',
      job_action => 'begin ctx_ddl.sync_index('...'); end;',
      repeat_interval => 'freq=secondly;interval=60',
      comments => 'run every minute',
      enabled => true);
    end;

Upvotes: 3

Views: 1153

Answers (2)

Miikka
Miikka

Reputation: 4653

Nowadays you can use Flyway callbacks. The afterClean callback is what you're looking for.

Upvotes: 1

Axel Fontaine
Axel Fontaine

Reputation: 35169

Custom clean scripts are not supported out of the box.

You would have to wrap the Flyway.clean() execution with your own cleanup code.

Upvotes: 1

Related Questions