Module org.jooq
Package org.jooq

Interface Version

All Superinterfaces:
Node<Version>, Scope

@Experimental public interface Version extends Node<Version>
A version ID attached to a Meta description of a database.

Unlike a Commit, which describes a change between two versions of a database, this type just describes the version itself, not how to get to the version.

While it is possible to describe a path between versions using a migration (e.g. composed of Queries), the versions themselves do not expose this information.

This is EXPERIMENTAL functionality and subject to change in future jOOQ versions.

Author:
Lukas Eder
  • Method Details

    • meta

      @NotNull @NotNull Meta meta()
      The version's Meta representation of the database.
    • migrateTo

      @NotNull @NotNull Queries migrateTo(Version version)
      Produce a migration to a new version.

      In jOOQ's commercial distributions, this method allows for migrating between versions in any direction, regardless of which version was "first" in a version graph, or if the two versions are on different branches. The resulting queries are potentially destructive in such a case. Such destructive queries ("UNDO" migrations) are prevented by default, and can be turned on using Settings.isMigrationAllowsUndo().

      In jOOQ's Open Source Edition, this method only allows for migrating "forward".

    • commit

      @NotNull @NotNull Version commit(String id, Meta meta)
      Commit a new Meta representation to the version graph.

      This calculates a migration path using Meta.migrateTo(Meta).

    • commit

      @NotNull @NotNull Version commit(String id, String... meta)
      Commit a new Meta representation to the version graph.
      See Also:
    • commit

      @NotNull @NotNull Version commit(String id, Source... meta)
      Commit a new Meta representation to the version graph.
      See Also:
    • merge

      @NotNull @NotNull Version merge(String id, Version with)
      Merge versions.
    • apply

      @NotNull @NotNull Version apply(String id, Queries migration)
      Apply a migration to produce a new version.
    • apply

      @NotNull @NotNull Version apply(String id, Query... migration)
      Apply a migration to produce a new version.
      See Also:
    • apply

      @NotNull @NotNull Version apply(String id, Collection<? extends Query> migration)
      Apply a migration to produce a new version.
      See Also:
    • apply

      @NotNull @NotNull Version apply(String id, String migration)
      Apply a migration to produce a new version.
      See Also: