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 8ae3129 commit 19bf4a3
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Column/ColumnDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
{
protected const AUTO_INCREMENT_KEYWORD = 'IDENTITY';

protected const CLAUSES = [
'type',
'auto_increment',
'primary_key',
'unique',
'not_null',
'default',
'check',
'references',
'extra',
];

protected const GENERATE_UUID_EXPRESSION = 'newid()';

protected const TYPES_WITH_SIZE = [
Expand All @@ -48,6 +36,19 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder
'numeric',
];

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

protected function getDbType(ColumnSchemaInterface $column): string
{
/** @psalm-suppress DocblockTypeContradiction */
Expand Down

0 comments on commit 19bf4a3

Please sign in to comment.