36 lines
885 B
PHP
36 lines
885 B
PHP
<?php
|
|
|
|
namespace Ulmus\Entity\Mysql;
|
|
|
|
use Ulmus\Attribute\Property\Field;
|
|
|
|
class Column extends \Ulmus\Entity\InformationSchema\Column
|
|
{
|
|
##[Field\Id]
|
|
#public ? id $srs_id;
|
|
|
|
#[Field(name: "COLUMN_KEY", length: 3)]
|
|
public string $key;
|
|
|
|
#[Field(name: "EXTRA", length: 30)]
|
|
public string $extra;
|
|
|
|
#[Field(name: "PRIVILEGES", length: 80)]
|
|
public string $privileges;
|
|
|
|
#[Field(name: "COLUMN_COMMENT", length: 1024)]
|
|
public string $comment;
|
|
|
|
##[Field(name: "GENERATION_EXPRESSION", type: "longtext")]
|
|
#public ? string $generationExpression;
|
|
|
|
# TODO ! Handle FUNCTIONAL default value
|
|
protected function canHaveDefaultValue(): bool
|
|
{
|
|
return ! in_array(strtoupper($this->dataType), [
|
|
'BLOB', 'TINYBLOB', 'MEDIUMBLOB', 'LONGBLOB', 'JSON', 'TEXT', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT', 'GEOMETRY'
|
|
]);
|
|
}
|
|
|
|
|
|
} |