class Cql::Migration
Reference
< Object
Migrations are used to manage changes to the database schema over time. Each migration is a subclass of Migration
and must implement the up
and down
methods.
The up
method is used to apply the migration, while the down
method is used to rollback the migration. Migrations are executed in their version order defined. The Migrator
class is used to manage migrations and provides methods to apply, rollback, and redo migrations. The Migrator
class also provides methods to list applied and pending migrations.
Example Creating a new migration
Example Applying migrations
Example Rolling back migrations
Example Redoing migrations
Example Rolling back to a specific version
Example Applying to a specific version
Example Listing applied migrations
Example Listing pending migrations
Example Listing rolled back migrations
Example Listing the last migration
Constructors
def new(schema : Schema)
(schema : Schema)