Forge.php
system/Database/Forge.php
1 class
37 methods
class Forge
The Forge class transforms migrations to executable SQL statements.
__construct
(BaseConnection $db)
getConnection
()
createDatabase
(string $dbName, bool $ifNotExists = false)
databaseExists
(string $dbName)
dropDatabase
(string $dbName)
addKey
($key, bool $primary = false, bool $unique = false, string $keyName = '')
addPrimaryKey
($key, string $keyName = '')
addUniqueKey
($key, string $keyName = '')
addField
($fields)
addForeignKey
($fieldName = '', string $tableName = '', $tableField = '', string $onUpdate = '', string $onDelete = '', string $fkName = '', )
dropKey
(string $table, string $keyName, bool $prefixKeyName = true)
dropKeyAsConstraint
(string $table, string $constraintName)
_dropKeyAsConstraint
(string $table, string $constraintName)
dropPrimaryKey
(string $table, string $keyName = '')
dropForeignKey
(string $table, string $foreignName)
createTable
(string $table, bool $ifNotExists = false, array $attributes = [])
_createTable
(string $table, bool $ifNotExists, array $attributes)
_createTableAttributes
(array $attributes)
dropTable
(string $tableName, bool $ifExists = false, bool $cascade = false)
_dropTable
(string $table, bool $ifExists, bool $cascade)
renameTable
(string $tableName, string $newTableName)
addColumn
(string $table, $fields)
dropColumn
(string $table, $columnNames)
modifyColumn
(string $table, $fields)
_alterTable
(string $alterType, string $table, $processedFields)
_processFields
(bool $createTable = false)
_processColumn
(array $processedField)
_attributeType
(array &$attributes)
_attributeUnsigned
(array &$attributes, array &$field)
_attributeDefault
(array &$attributes, array &$field)
_attributeUnique
(array &$attributes, array &$field)
_attributeAutoIncrement
(array &$attributes, array &$field)
_processPrimaryKeys
(string $table, bool $asQuery = false)
processIndexes
(string $table)
_processIndexes
(string $table, bool $asQuery = false)
_processForeignKeys
(string $table, bool $asQuery = false)
reset
()