Schema
abstract class Schema
Database schema base class
Properties
protected string | $tableName | Table name | |
protected string | $storageEngine | Db storage engine |
Methods
Create table
Update existing table
Return table name
Return model table name
Create table
Update table
Execute seeds
Return true if table is empty
Get query builder for table
Changes db table row format
Execute blueprint.
Check if database exist.
Drop table
Get column type
Checkif table exist
Check if table column exists.
Return true if index exist
Return shema object
Run Create and Update migration
UnInstall migration
Details
at line 46
abstract void
create(TableBlueprint $table)
Create table
at line 54
abstract void
update(TableBlueprint $table)
Update existing table
at line 62
void
seeds(Seed $seed)
Insert or update rows in table
at line 71
string
getTableName()
Return table name
at line 82
static bool|string
getTable(string $class)
Return model table name
at line 94
void
createTable()
Create table
at line 116
void
updateTable()
Update table
at line 136
mixed|false
runSeeds()
Execute seeds
at line 152
bool
isEmpty()
Return true if table is empty
at line 165
static QueryBuilder
getQuery(string $tableName)
Get query builder for table
at line 177
static boolean
setRowFormat(string $table, string $format = 'DYNAMIC')
Changes db table row format
at line 189
void
build(TableBlueprint $blueprint, Builder $builder)
Execute blueprint.
at line 203
static bool
hasTable(object|string $model)
Check if database exist.
at line 228
bool
dropTable(boolean $emptyOnly = true)
Drop table
at line 246
string
getColumnType(string $columnName)
Get column type
at line 256
bool
tableExists()
Checkif table exist
at line 267
boolean
hasColumn(string $column)
Check if table column exists.
at line 278
bool
hasIndex(string $indexName)
Return true if index exist
at line 299
static object
schema()
Return shema object
at line 312
static bool
install(string $class, string|null $extension = null, bool $showErorr = false)
Run Create and Update migration
at line 355
static bool
unInstall(string $class, string|null $extension = null, bool $force = false)
UnInstall migration