mongock

mongock: @Execution vs @BeforeExecution


Where is I should define scheme validation rules using mongock as migration tool? In official library examples it's placed in the @BeforeExecution section. Why?


Solution

  • From the official documentation:

    So you should include your DDL changes in @BeforeExecution method.

    For more details about ChangeUnit please check the documentation at this link.