class Blueprint (View source)
string | $engine | The storage engine that should be used for the table. | |
$charset | The default character set that should be used for the table. | ||
$collation | The collation that should be used for the table. | ||
bool | $temporary | Whether to make the table temporary. |
void | __construct( string $table, Closure $callback = null) Create a new schema blueprint. | |
void | build( Connection $connection, Grammar $grammar) Execute the blueprint against the database. | |
array | toSql( Connection $connection, Grammar $grammar) Get the raw SQL statements for the blueprint. | |
Fluent | create() Indicate that the table needs to be created. | |
void | temporary() Indicate that the table needs to be temporary. | |
Fluent | drop() Indicate that the table should be dropped. | |
Fluent | dropIfExists() Indicate that the table should be dropped if it exists. | |
Fluent | dropColumn( array|mixed $columns) Indicate that the given columns should be dropped. | |
Fluent | renameColumn( string $from, string $to) Indicate that the given columns should be renamed. | |
Fluent | dropPrimary( string|array $index = null) Indicate that the given primary key should be dropped. | |
Fluent | dropUnique( string|array $index) Indicate that the given unique key should be dropped. | |
Fluent | dropIndex( string|array $index) Indicate that the given index should be dropped. | |
Fluent | dropForeign( string $index) Indicate that the given foreign key should be dropped. | |
void | dropTimestamps() Indicate that the timestamp columns should be dropped. | |
void | dropTimestampsTz() Indicate that the timestamp columns should be dropped. | |
void | dropSoftDeletes() Indicate that the soft delete column should be dropped. | |
void | dropRememberToken() Indicate that the remember token column should be dropped. | |
Fluent | rename( string $to) Rename the table to a given name. | |
Fluent | primary( string|array $columns, string $name = null) Specify the primary key(s) for the table. | |
Fluent | unique( string|array $columns, string $name = null) Specify a unique index for the table. | |
Fluent | index( string|array $columns, string $name = null) Specify an index for the table. | |
Fluent | foreign( string|array $columns, string $name = null) Specify a foreign key for the table. | |
Fluent | increments( string $column) Create a new auto-incrementing integer (4-byte) column on the table. | |
Fluent | smallIncrements( string $column) Create a new auto-incrementing small integer (2-byte) column on the table. | |
Fluent | mediumIncrements( string $column) Create a new auto-incrementing medium integer (3-byte) column on the table. | |
Fluent | bigIncrements( string $column) Create a new auto-incrementing big integer (8-byte) column on the table. | |
Fluent | char( string $column, int $length = 255) Create a new char column on the table. | |
Fluent | string( string $column, int $length = 255) Create a new string column on the table. | |
Fluent | text( string $column) Create a new text column on the table. | |
Fluent | mediumText( string $column) Create a new medium text column on the table. | |
Fluent | longText( string $column) Create a new long text column on the table. | |
Fluent | integer( string $column, bool $autoIncrement = false, bool $unsigned = false) Create a new integer (4-byte) column on the table. | |
Fluent | tinyInteger( string $column, bool $autoIncrement = false, bool $unsigned = false) Create a new tiny integer (1-byte) column on the table. | |
Fluent | smallInteger( string $column, bool $autoIncrement = false, bool $unsigned = false) Create a new small integer (2-byte) column on the table. | |
Fluent | mediumInteger( string $column, bool $autoIncrement = false, bool $unsigned = false) Create a new medium integer (3-byte) column on the table. | |
Fluent | bigInteger( string $column, bool $autoIncrement = false, bool $unsigned = false) Create a new big integer (8-byte) column on the table. | |
Fluent | unsignedTinyInteger( string $column, bool $autoIncrement = false) Create a new unsigned tiny integer (1-byte) column on the table. | |
Fluent | unsignedSmallInteger( string $column, bool $autoIncrement = false) Create a new unsigned small integer (2-byte) column on the table. | |
Fluent | unsignedMediumInteger( string $column, bool $autoIncrement = false) Create a new unsigned medium integer (3-byte) column on the table. | |
Fluent | unsignedInteger( string $column, bool $autoIncrement = false) Create a new unsigned integer (4-byte) column on the table. | |
Fluent | unsignedBigInteger( string $column, bool $autoIncrement = false) Create a new unsigned big integer (8-byte) column on the table. | |
Fluent | float( string $column, int $total = 8, int $places = 2) Create a new float column on the table. | |
Fluent | double( string $column, int|null $total = null, int|null $places = null) Create a new double column on the table. | |
Fluent | decimal( string $column, int $total = 8, int $places = 2) Create a new decimal column on the table. | |
Fluent | boolean( string $column) Create a new boolean column on the table. | |
Fluent | enum( string $column, array $allowed) Create a new enum column on the table. | |
Fluent | json( string $column) Create a new json column on the table. | |
Fluent | jsonb( string $column) Create a new jsonb column on the table. | |
Fluent | date( string $column) Create a new date column on the table. | |
Fluent | dateTime( string $column) Create a new date-time column on the table. | |
Fluent | dateTimeTz( string $column) Create a new date-time column (with time zone) on the table. | |
Fluent | time( string $column) Create a new time column on the table. | |
Fluent | timeTz( string $column) Create a new time column (with time zone) on the table. | |
Fluent | timestamp( string $column) Create a new timestamp column on the table. | |
Fluent | timestampTz( string $column) Create a new timestamp (with time zone) column on the table. | |
void | nullableTimestamps() Add nullable creation and update timestamps to the table. | |
void | timestamps() Add creation and update timestamps to the table. | |
void | timestampsTz() Add creation and update timestampTz columns to the table. | |
Fluent | softDeletes() Add a "deleted at" timestamp for the table. | |
Fluent | binary( string $column) Create a new binary column on the table. | |
Fluent | uuid( string $column) Create a new uuid column on the table. | |
void | morphs( string $name, string|null $indexName = null) Add the proper columns for a polymorphic table. | |
Fluent | rememberToken() Adds the | |
Fluent | addColumn( string $type, string $name, array $parameters = array()) Add a new column to the blueprint. | |
$this | removeColumn( string $name) Remove a column from the schema blueprint. | |
string | getTable() Get the table the blueprint describes. | |
array | getColumns() Get the columns on the blueprint. | |
array | getCommands() Get the commands on the blueprint. | |
array | getAddedColumns() Get the columns on the blueprint that should be added. | |
array | getChangedColumns() Get the columns on the blueprint that should be changed. |
Create a new schema blueprint.
Execute the blueprint against the database.
Get the raw SQL statements for the blueprint.
Indicate that the table needs to be created.
Indicate that the table needs to be temporary.
Indicate that the table should be dropped.
Indicate that the table should be dropped if it exists.
Indicate that the given columns should be dropped.
Indicate that the given columns should be renamed.
Indicate that the given primary key should be dropped.
Indicate that the given unique key should be dropped.
Indicate that the given index should be dropped.
Indicate that the given foreign key should be dropped.
Indicate that the timestamp columns should be dropped.
Indicate that the timestamp columns should be dropped.
Indicate that the soft delete column should be dropped.
Indicate that the remember token column should be dropped.
Rename the table to a given name.
Specify the primary key(s) for the table.
Specify a unique index for the table.
Specify an index for the table.
Specify a foreign key for the table.
Create a new auto-incrementing integer (4-byte) column on the table.
Create a new auto-incrementing small integer (2-byte) column on the table.
Create a new auto-incrementing medium integer (3-byte) column on the table.
Create a new auto-incrementing big integer (8-byte) column on the table.
Create a new char column on the table.
Create a new string column on the table.
Create a new text column on the table.
Create a new medium text column on the table.
Create a new long text column on the table.
Create a new integer (4-byte) column on the table.
Create a new tiny integer (1-byte) column on the table.
Create a new small integer (2-byte) column on the table.
Create a new medium integer (3-byte) column on the table.
Create a new big integer (8-byte) column on the table.
Create a new unsigned tiny integer (1-byte) column on the table.
Create a new unsigned small integer (2-byte) column on the table.
Create a new unsigned medium integer (3-byte) column on the table.
Create a new unsigned integer (4-byte) column on the table.
Create a new unsigned big integer (8-byte) column on the table.
Create a new float column on the table.
Create a new double column on the table.
Create a new decimal column on the table.
Create a new boolean column on the table.
Create a new enum column on the table.
Create a new json column on the table.
Create a new jsonb column on the table.
Create a new date column on the table.
Create a new date-time column on the table.
Create a new date-time column (with time zone) on the table.
Create a new time column on the table.
Create a new time column (with time zone) on the table.
Create a new timestamp column on the table.
Create a new timestamp (with time zone) column on the table.
Add nullable creation and update timestamps to the table.
Add creation and update timestamps to the table.
Add creation and update timestampTz columns to the table.
Add a "deleted at" timestamp for the table.
Create a new binary column on the table.
Create a new uuid column on the table.
Add the proper columns for a polymorphic table.
Adds the remember_token
column to the table.
Add a new column to the blueprint.
Remove a column from the schema blueprint.
Get the table the blueprint describes.
Get the columns on the blueprint.
Get the commands on the blueprint.
Get the columns on the blueprint that should be added.
Get the columns on the blueprint that should be changed.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Database/Schema/Blueprint.html