Download the PHP package fyre/migration without Composer
On this page you can find all versions of the php package fyre/migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package migration
FyreMigration
FyreMigration is a free, open-source migration library for PHP.
Table Of Contents
- Installation
- Basic Usage
- Methods
- Migrations
- Migration Histories
- Commands
- Migrate
- Rollback
Installation
Using Composer
In PHP:
Basic Usage
$container
is a Container.$loader
is a Loader.$connectionManager
is a ConnectionManager.$forgeRegistry
is a ForgeRegistry.
Autoloading
It is recommended to bind the MigrationRunner to the Container as a singleton.
Any dependencies will be injected automatically when loading from the Container.
Methods
Add Namespace
Add a namespace for loading migrations.
$namespace
is a string representing the namespace.
Clear
Clear all namespaces and migrations.
Get Connection
Get the Connection.
Get Forge
Get the Forge.
Get History
Get the MigrationHistory.
Get Migrations
Get all migrations.
Get Namespaces
Get the namespaces.
Has Namespace
Determine whether a namespace exists.
$namespace
is a string representing the namespace.
Migrate
Migrate to the latest version.
Rollback
Rollback to a previous version.
$batches
is a number representing the number of batches to rollback, and will default to 1.$steps
is a number representing the number of steps to rollback, and will default to null.
Set Connection
Set the Connection.
$connection
is the Connection.
Remove Namespace
Remove a namespace.
$namespace
is a string representing the namespace.
Migrations
Migrations can be created by extending the \Fyre\Migration\Migration
class, prefixing the class name with "Migration_".
To allow discovery of the migration, add the the namespace to the MigrationRunner.
Down
Perform a "down" migration.
Up
Perform an "up" migration.
Migration Histories
Add
Add a migration version to the history.
$name
is a string representing the migration name.$batch
is a number representing the batch number.
All
Get the migration history.
Delete
Delete a migration from the history.
$name
is a string representing the migration name.
Get Next Batch
Get the next batch number.
Commands
Migrate
Perform database migrations.
--db
is the ConnectionManager config key, and will default toConnectionManager::DEFAULT
.
Rollback
Perform database rollbacks.
--db
is the ConnectionManager config key, and will default toConnectionManager::DEFAULT
.--batches
is the number of batches to rollback, and will default to 1.--steps
is the number of steps to rollback, and will default to null.
All versions of migration with dependencies
fyre/container Version ^1.0
fyre/filesystem Version ^2.0
fyre/forge Version ^5.0
fyre/loader Version ^3.0