Package com.vireocode.vireo.flyway
Record Class StarterFlywayModule
java.lang.Object
java.lang.Record
com.vireocode.vireo.flyway.StarterFlywayModule
- Record Components:
name- short module name, for exampleauthorder- relative order across modules. Lower runs first. Only matters where one module's tables have foreign keys into another's:history,saved_filterandsync_commandall referenceapp_user, so auth migrates first.
A module's claim on a set of database tables.
Library-owned tables need library-owned migrations, and the dangerous way to
do that is to drop them into the consumer's db/migration folder and
share one flyway_schema_history. Version numbers would then be a
shared namespace between two independently released codebases: the library
ships V2, the consumer already applied V20260801120000, and
the upgrade is an out-of-order migration against a live database.
So each module migrates separately, into its own history table. The library and the consumer can then both number their migrations from one and never meet.
Everything is derived from name() by convention, because a
mis-declared history table would be discovered in production rather than in a
build.
-
Constructor Summary
ConstructorsConstructorDescriptionStarterFlywayModule(String name, int order) Creates an instance of aStarterFlywayModulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionMigrations every database gets.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Neverflyway_schema_history.name()Returns the value of thenamerecord component.intorder()Returns the value of theorderrecord component.final StringtoString()Returns a string representation of this record class.vendorLocation(String vendor) Migrations only one database vendor gets, mirroring theclasspath:db/vendor/{vendor}convention consumers already use.
-
Constructor Details
-
Method Details
-
commonLocation
Migrations every database gets. -
vendorLocation
Migrations only one database vendor gets, mirroring theclasspath:db/vendor/{vendor}convention consumers already use. Absent directories are not an error. -
historyTable
Neverflyway_schema_history. That one belongs to the consumer. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
order
public int order()Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-