UserFrosting API

DatabaseMigrationRepository implements MigrationRepositoryInterface

MigrationRepository Class.

Repository used to store all migrations run against the database

Tags
author

Louis Charette

Table of Contents

$db Manager
$table string
$connection string
__construct() Create a new database migration repository instance. mixed
getMigrationsList() Get the list of ran migrations. array
getMigrations() Get list of migrations. array
getMigration() Get details about a specific migration. stdClass
getLast() Get the last migration batch in reserve order they were ran (last one first). array
log() Log that a migration was run. mixed
delete() Remove a migration from the log. mixed
getNextBatchNumber() Get the next migration batch number. int
getLastBatchNumber() Get the last migration batch number. int
createRepository() Create the migration repository data store. mixed
deleteRepository() Delete the migration repository data store. mixed
repositoryExists() Determine if the migration repository exists. bool
table() Get a query builder for the migration table. Builder
getSchemaBuilder() Returns the schema builder instance. Builder
getConnection() Resolve the database connection instance. Connection
setSource() Set the information source to gather data. mixed

Properties

Methods

__construct()

Create a new database migration repository instance.

public __construct( $db : Manager [, $table : string = 'migrations' ] ) : mixed
Parameters
$db : Manager
$table : string = 'migrations'
Return values
mixed

getMigrationsList()

Get the list of ran migrations.

public getMigrationsList( [ $steps : int = -1 ] [, $order : string = 'asc' ] ) : array
Parameters
$steps : int = -1

Number of batch to return

$order : string = 'asc'

asc|desc

Return values
array

An array of migration class names in the order they where ran

getMigrations()

Get list of migrations.

public getMigrations( [ $steps : int = -1 ] [, $order : string = 'asc' ] ) : array
Parameters
$steps : int = -1

Number of batch to return

$order : string = 'asc'

asc|desc

Return values
array

getMigration()

Get details about a specific migration.

public getMigration( $migration : string ) : stdClass
Parameters
$migration : string

The migration class

Return values
stdClass

The migration info

getLast()

Get the last migration batch in reserve order they were ran (last one first).

public getLast( ) : array
Return values
array

log()

Log that a migration was run.

public log( $file : string , $batch : int [, $sprinkle : string = '' ] ) : mixed
Parameters
$file : string
$batch : int
$sprinkle : string = ''
Return values
mixed

delete()

Remove a migration from the log.

public delete( $migration : string ) : mixed
Parameters
$migration : string
Return values
mixed

createRepository()

Create the migration repository data store.

public createRepository( ) : mixed
Return values
mixed

deleteRepository()

Delete the migration repository data store.

public deleteRepository( ) : mixed
Return values
mixed

repositoryExists()

Determine if the migration repository exists.

public repositoryExists( ) : bool
Return values
bool

getConnection()

Resolve the database connection instance.

public getConnection( ) : Connection
Return values
Connection

setSource()

Set the information source to gather data.

public setSource( $name : string ) : mixed
Parameters
$name : string

The source name

Return values
mixed

Search results