Skip to content

Commit

Permalink
Remove CLAUSES constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Oct 9, 2024
1 parent 1938df1 commit e087c6b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/Column/ColumnDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@

final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
{
protected const CLAUSES = [
'type',
'not_null',
'primary_key',
'unique',
'default',
'check',
'references',
'extra',
];

protected const GENERATE_UUID_EXPRESSION = 'gen_random_uuid()';

protected const TYPES_WITH_SIZE = [
Expand All @@ -46,6 +35,18 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
'numeric',
];

public function build(ColumnSchemaInterface $column): string
{
return $this->buildType($column)
. $this->buildNotNull($column)
. $this->buildPrimaryKey($column)
. $this->buildUnique($column)
. $this->buildDefault($column)
. $this->buildCheck($column)
. $this->buildReferences($column)
. $this->buildExtra($column);
}

protected function buildType(ColumnSchemaInterface $column): string
{
if ($column instanceof \Yiisoft\Db\Schema\Column\ArrayColumnSchema) {
Expand Down

0 comments on commit e087c6b

Please sign in to comment.