MigrationRepositoryInterface
MigrationRepository Interface.
Tags
Table of Contents
getMigrationsList() | Get the list of ran migrations. | array |
---|---|---|
getMigrations() | Get list of migrations. | array |
getLast() | Get the last migration batch. | 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 |
setSource() | Set the information source to gather data. | mixed |
Methods
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
arraygetLast()
Get the last migration batch.
public
getLast(
)
: array
Return values
arraylog()
Log that a migration was run.
public
log(
$file :
string
, $batch :
int
)
: mixed
Parameters
- $file : string
- $batch : int
Return values
mixeddelete()
Remove a migration from the log.
public
delete(
$migration :
string
)
: mixed
Parameters
- $migration : string
Return values
mixedgetNextBatchNumber()
Get the next migration batch number.
public
getNextBatchNumber(
)
: int
Return values
intgetLastBatchNumber()
Get the last migration batch number.
public
getLastBatchNumber(
)
: int
Return values
intcreateRepository()
Create the migration repository data store.
public
createRepository(
)
: mixed
Return values
mixeddeleteRepository()
Delete the migration repository data store.
public
deleteRepository(
)
: mixed
Return values
mixedrepositoryExists()
Determine if the migration repository exists.
public
repositoryExists(
)
: bool
Return values
boolsetSource()
Set the information source to gather data.
public
setSource(
$name :
string
)
: mixed
Parameters
- $name : string
The source name