Builder
Properties
$defaultStringLength int
The default string length for migrations.
$defaultMorphKeyType string
The default relationship morph key type.
Methods
__construct ( Connection $connection ) : void
Create a new database Schema manager.
Parameters
- $connection Connection
defaultStringLength ( $length ) : void
Set the default string length for migrations.
Parameters
- $length int
defaultMorphKeyType ( string $type ) : void
Set the default morph key type for migrations.
Parameters
- $type string
morphUsingUuids ( ) : void
Set the default morph key type for migrations to UUIDs.
createDatabase ( $name ) : bool
Create a database in the schema.
Parameters
- $name string
dropDatabaseIfExists ( $name ) : bool
Drop a database from the schema if the database exists.
Parameters
- $name string
hasTable ( $table ) : bool
Determine if the given table exists.
Parameters
- $table string
hasColumn ( $table , $column ) : bool
Determine if the given table has a given column.
Parameters
- $table string
- $column string
hasColumns ( $table , array $columns ) : bool
Determine if the given table has given columns.
Parameters
- $table string
- $columns array
getColumnType ( $table , $column ) : string
Get the data type for the given column name.
Parameters
- $table string
- $column string
getColumnListing ( $table ) : array
Get the column listing for a given table.
Parameters
- $table string
table ( $table , Closure $callback ) : void
Modify a table on the schema.
Parameters
- $table string
- $callback Closure
create ( $table , Closure $callback ) : void
Create a new table on the schema.
Parameters
- $table string
- $callback Closure
drop ( $table ) : void
Drop a table from the schema.
Parameters
- $table string
dropIfExists ( $table ) : void
Drop a table from the schema if it exists.
Parameters
- $table string
dropColumns ( $table , $columns ) : void
Drop columns from a table schema.
Parameters
- $table string
- $columns string|array
dropAllTables ( ) : void
Drop all tables from the database.
dropAllViews ( ) : void
Drop all views from the database.
dropAllTypes ( ) : void
Drop all types from the database.
getAllTables ( ) : void
Get all of the table names for the database.
rename ( $from , $to ) : void
Rename a table on the schema.
Parameters
- $from string
- $to string
enableForeignKeyConstraints ( ) : bool
Enable foreign key constraints.
disableForeignKeyConstraints ( ) : bool
Disable foreign key constraints.
build ( Blueprint $blueprint ) : void
Execute the blueprint to build / modify the table.
Parameters
- $blueprint Blueprint
createBlueprint ( $table , Closure $callback ) : Blueprint
Create a new command set with a Closure.
Parameters
- $table string
- $callback Closure |null
registerCustomDoctrineType ( $class , $name , $type ) : void
Register a custom Doctrine mapping type.
Parameters
- $class string
- $name string
- $type string
setConnection ( Connection $connection ) : $this
Set the database connection instance.
Parameters
- $connection Connection