Documentation

Migrator extends AbstractMigrator
in package

Sql migrator class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.3.0

Table of Contents

$current  : string
Current migration position
$db  : AbstractAdapter
Database adapter
$migrations  : array<string|int, mixed>
Migrations
$path  : string
Migration path
__construct()  : mixed
Constructor
create()  : string
Create new migration file
db()  : AbstractAdapter
Get the DB adapter (alias method)
getCurrent()  : string
Get the migration path
getDb()  : AbstractAdapter
Get the DB adapter
getPath()  : string
Get the migration path
rollback()  : Migrator
Roll back the migrator (down/backward direction)
rollbackAll()  : Migrator
Roll back all the migrator (down/backward direction)
run()  : Migrator
Run the migrator (up/forward direction)
runAll()  : Migrator
Run all the migrator (up/forward direction)
setPath()  : Migrator
Set the migration path and get migration files

Properties

$current

Current migration position

protected string $current = null

$migrations

Migrations

protected array<string|int, mixed> $migrations = []

$path

Migration path

protected string $path = null

Methods

__construct()

Constructor

public __construct(AbstractAdapter $db, string $path) : mixed

Instantiate the migrator object

Parameters
$db : AbstractAdapter
$path : string
Return values
mixed

create()

Create new migration file

public static create(string $class[, string $path = null ]) : string
Parameters
$class : string
$path : string = null
Tags
throws
Exception
Return values
string

getCurrent()

Get the migration path

public getCurrent() : string
Return values
string

getPath()

Get the migration path

public getPath() : string
Return values
string

rollback()

Roll back the migrator (down/backward direction)

public rollback([mixed $steps = 1 ]) : Migrator
Parameters
$steps : mixed = 1
Return values
Migrator

rollbackAll()

Roll back all the migrator (down/backward direction)

public rollbackAll() : Migrator
Return values
Migrator

run()

Run the migrator (up/forward direction)

public run([mixed $steps = 1 ]) : Migrator
Parameters
$steps : mixed = 1
Return values
Migrator

setPath()

Set the migration path and get migration files

public setPath(string $path) : Migrator
Parameters
$path : string
Tags
throws
Exception
Return values
Migrator

Search results