DbUpdater
in package
Actualiza la estructura de la base de datos.
Tags
Table of Contents
- FILE_NAME = 'db-updater.json'
- $checkedTables : array<string|int, mixed>
- $dataBase : DataBase
- $sqlTool : DataBaseQueries
- createTable() : bool
- dropTable() : bool
- getTableXmlLocation() : string
- isTableChecked() : bool
- readTableXml() : array<string|int, mixed>
- rebuild() : void
- updateTable() : bool
- compareColumns() : string
- compareConstraints() : string
- compareDataTypes() : bool
- db() : DataBase
- save() : void
- searchInArray() : array<string|int, mixed>
- sqlTool() : DataBaseQueries
Constants
FILE_NAME
public
mixed
FILE_NAME
= 'db-updater.json'
Properties
$checkedTables
private
static array<string|int, mixed>
$checkedTables
$dataBase
private
static DataBase
$dataBase
$sqlTool
private
static DataBaseQueries
$sqlTool
Methods
createTable()
public
static createTable(string $tableName[, array<string|int, mixed> $structure = [] ][, string $sqlAfter = '' ]) : bool
Parameters
- $tableName : string
- $structure : array<string|int, mixed> = []
- $sqlAfter : string = ''
Return values
bool —dropTable()
public
static dropTable(string $tableName) : bool
Parameters
- $tableName : string
Return values
bool —getTableXmlLocation()
public
static getTableXmlLocation(string $tableName) : string
Parameters
- $tableName : string
Return values
string —isTableChecked()
public
static isTableChecked(string $tableName) : bool
Parameters
- $tableName : string
Return values
bool —readTableXml()
public
static readTableXml(string $filePath) : array<string|int, mixed>
Parameters
- $filePath : string
Return values
array<string|int, mixed> —rebuild()
public
static rebuild() : void
Return values
void —updateTable()
public
static updateTable(string $tableName[, array<string|int, mixed> $structure = [] ]) : bool
Parameters
- $tableName : string
- $structure : array<string|int, mixed> = []
Return values
bool —compareColumns()
private
static compareColumns(string $tableName, array<string|int, mixed> $xmlCols, array<string|int, mixed> $dbCols) : string
Parameters
- $tableName : string
- $xmlCols : array<string|int, mixed>
- $dbCols : array<string|int, mixed>
Return values
string —compareConstraints()
private
static compareConstraints(string $tableName, array<string|int, mixed> $xmlCons, array<string|int, mixed> $dbCons) : string
Parameters
- $tableName : string
- $xmlCons : array<string|int, mixed>
- $dbCons : array<string|int, mixed>
Return values
string —compareDataTypes()
private
static compareDataTypes(string $dbType, string $xmlType) : bool
Parameters
- $dbType : string
- $xmlType : string
Return values
bool —db()
private
static db() : DataBase
Return values
DataBase —save()
private
static save(string $tableName) : void
Parameters
- $tableName : string
Return values
void —searchInArray()
private
static searchInArray(array<string|int, mixed> $items, string $index, string $value) : array<string|int, mixed>
Parameters
- $items : array<string|int, mixed>
- $index : string
- $value : string
Return values
array<string|int, mixed> —sqlTool()
private
static sqlTool() : DataBaseQueries