CreateTable
- Full name:
\Qubus\Expressive\Schema\CreateTable
Properties
columns
protected \Qubus\Expressive\Schema\CreateColumn[] $columns
primaryKey
protected array{name: string, columns: list<string>}|null $primaryKey
uniqueKeys
protected array<string,list<string>> $uniqueKeys
indexes
protected array<string,list<string>> $indexes
foreignKeys
protected array<string,\Qubus\Expressive\Schema\ForeignKey> $foreignKeys
table
engine
protected string|null $engine
autoincrement
protected ?\Qubus\Expressive\Schema\BaseColumn $autoincrement
Methods
__construct
public __construct(string $table): mixed
Parameters:
| Parameter | Type | Description |
$table | string | |
addColumn
protected addColumn(string $name, string $type): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
$type | string | |
getTableName
public getTableName(): string
getColumns
public getColumns(): \Qubus\Expressive\Schema\CreateColumn[]
getPrimaryKey
public getPrimaryKey(): array{name: string, columns: list<string>}|null
getUniqueKeys
public getUniqueKeys(): array
getIndexes
public getIndexes(): array
getForeignKeys
public getForeignKeys(): array
getEngine
public getEngine(): string|null
getAutoincrement
public getAutoincrement(): \Qubus\Expressive\Schema\BaseColumn|null
engine
public engine(string $name): $this
Parameters:
| Parameter | Type | Description |
$name | string | |
primary
public primary(string|string[] $columns, ?string $name = null): $this
Parameters:
| Parameter | Type | Description |
$columns | string|string[] | |
$name | ?string | |
unique
public unique(string|string[] $columns, ?string $name = null): $this
Parameters:
| Parameter | Type | Description |
$columns | string|string[] | |
$name | ?string | |
index
public index(string|string[] $columns, ?string $name = null): $this
Parameters:
| Parameter | Type | Description |
$columns | string|string[] | |
$name | ?string | |
foreign
public foreign(string|string[] $columns, ?string $name = null): \Qubus\Expressive\Schema\ForeignKey
Parameters:
| Parameter | Type | Description |
$columns | string|string[] | |
$name | ?string | |
autoincrement
public autoincrement(\Qubus\Expressive\Schema\CreateColumn $column, ?string $name = null): $this
Parameters:
| Parameter | Type | Description |
$column | \Qubus\Expressive\Schema\CreateColumn | |
$name | ?string | |
integer
public integer(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
float
public float(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
double
public double(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
decimal
public decimal(string $name, ?int $length = null, ?int $precision = null): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
$length | ?int | |
$precision | ?int | |
boolean
public boolean(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
binary
public binary(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
string
public string(string $name, int $length = 255): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
$length | int | |
fixed
public fixed(string $name, int $length = 255): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
$length | int | |
text
public text(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
time
public time(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
timestamp
public timestamp(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
date
public date(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
dateTime
public dateTime(string $name): \Qubus\Expressive\Schema\CreateColumn
Parameters:
| Parameter | Type | Description |
$name | string | |
softDelete
public softDelete(string $column = 'deleted_at'): $this
Parameters:
| Parameter | Type | Description |
$column | string | |
timestamps
public timestamps(string $createColumn = 'created_at', string $updateColumn = 'updated_at'): $this
Parameters:
| Parameter | Type | Description |
$createColumn | string | |
$updateColumn | string | |