Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public interface JavaMigration

A migration written in Java, for a change SQL cannot express: recomputing a column, moving data between tables with logic in between.

It runs once, in version order with the SQL migrations, inside the same transaction a script would get. It has no checksum, so editing the class after it ran is not detected.

Methods

public abstract void migrate(MigrationContext context) throws IOExceptionApplies the change.

Method details

migrate

public abstract void migrate(MigrationContext context) throws IOException
Applies the change.

Parameters

context MigrationContext
the connection the migration runs on

Throws

IOException
if the database refuses a statement; the migration is then rolled back where the engine can roll schema changes back, and recorded as failed where it cannot