Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/Annotation/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ final class Column

/**
* @param non-empty-string $type Column type. {@see \Cycle\Database\Schema\AbstractColumn::$mapping}
* Column types `smallPrimary`, `timetz`, `timestamptz`, `interval`, `bitVarying`, `int4range`, `int8range`,
* `numrange`, `tsrange`, `tstzrange`, `daterange`, `jsonb`, `point`, `line`, `lseg`, `box`, `path`,
* `polygon`, `circle`, `cidr`, `inet`, `macaddr`, `macaddr8`, `tsvector`, `tsquery` are related
* to the PostgreSQL only {@see \Cycle\Database\Driver\Postgres\Schema\PostgresColumn::$mapping}
* Column type `datetime2` is related to the SQL Server only
* {@see \Cycle\Database\Driver\SQLServer\Schema\SQLServerColumn::$mapping}
* @param non-empty-string|null $name Column name. Defaults to the property name.
* @param non-empty-string|null $property Property that belongs to column. For virtual columns.
* @param bool $primary Explicitly set column as a primary key.
Expand All @@ -38,9 +44,15 @@ final class Column
*/
public function __construct(
#[ExpectedValues(values: ['primary', 'bigPrimary', 'enum', 'boolean',
'integer', 'tinyInteger', 'smallInteger', 'bigInteger',
'string', 'text', 'tinyText', 'longText', 'double', 'float', 'decimal', 'datetime', 'date', 'time',
'timestamp', 'binary', 'tinyBinary', 'longBinary', 'json', 'uuid',
'integer', 'tinyInteger', 'smallInteger', 'bigInteger', 'string', 'text', 'tinyText', 'longText', 'double',
'float', 'decimal', 'datetime', 'date', 'time', 'timestamp', 'binary', 'tinyBinary', 'longBinary', 'json',
'uuid', 'bit',
// PostgreSQL
'smallPrimary', 'timetz', 'timestamptz', 'interval', 'bitVarying', 'int4range', 'int8range', 'numrange',
'tsrange', 'tstzrange', 'daterange', 'jsonb', 'point', 'line', 'lseg', 'box', 'path', 'polygon', 'circle',
'cidr', 'inet', 'macaddr', 'macaddr8', 'tsvector', 'tsquery',
// SQL Server
'datetime2',
])]
private string $type,
private ?string $name = null,
Expand Down