com\setasign\SetaFramework\Database\Migration

MigrationGenerator

File: /SetaFramework/src/Database/Migration/MigrationGenerator.php

Class hierarchy

Summary

Constants

TYPE_PHP

private const MigrationGenerator::TYPE_PHP = 'php'

TYPE_QUERY

private const MigrationGenerator::TYPE_QUERY = 'query'

TYPE_REMOVE_SQL_MODE

private const MigrationGenerator::TYPE_REMOVE_SQL_MODE = 'removeSqlMode'

TYPE_RESTORE_SQL_MODE

private const MigrationGenerator::TYPE_RESTORE_SQL_MODE = 'restoreSqlMode'

Properties

$name

private string MigrationGenerator::$name

Methods

__construct()

public MigrationGenerator::__construct (
MigrationSaveInterface $migrationSave,
string $migrationManagerName
)
Parameters
$migrationSave : MigrationSaveInterface
 
$migrationManagerName : string
 

codeGenerator()

private MigrationGenerator::codeGenerator (
array $block
): string
Parameters
$block : array
 

downAddQuery()

public MigrationGenerator::downAddQuery (
string $query
): void
Parameters
$query : string
 

downPhpCode()

public MigrationGenerator::downPhpCode (
string $code
): void

Note: the code should be formatted with 8 leading spaces per line and \n as line separator.

Parameters
$code : string
 

downRemoveSqlMode()

public MigrationGenerator::downRemoveSqlMode (
string $sqlMode
): void
Parameters
$sqlMode : string

Multiple sql modes are possible and every sql mode must be separated with a pipe |.

downRestoreSqlMode()

public MigrationGenerator::downRestoreSqlMode (
void
): void

save()

public MigrationGenerator::save (
string $name,
bool $flagAsExecuted = true
): void
Parameters
$name : string
 
$flagAsExecuted : bool
 

upAddQuery()

public MigrationGenerator::upAddQuery (
string $query
): void
Parameters
$query : string
 

upPhpCode()

public MigrationGenerator::upPhpCode (
string $code
): void

Note: the code should be formatted with 8 leading spaces per line and \n as line separator.

Parameters
$code : string
 

upRemoveSqlMode()

public MigrationGenerator::upRemoveSqlMode (
string $sqlMode
): void
Parameters
$sqlMode : string

Multiple sql modes are possible and every sql mode must be separated with a pipe |.

upRestoreSqlMode()

public MigrationGenerator::upRestoreSqlMode (
void
): void