From e30cf845e25addd9b6997ae800cea7b98c8fa15d Mon Sep 17 00:00:00 2001 From: Tigrov Date: Wed, 9 Oct 2024 12:04:40 +0700 Subject: [PATCH] Remove `CLAUSES` constant --- src/Column/ColumnDefinitionBuilder.php | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Column/ColumnDefinitionBuilder.php b/src/Column/ColumnDefinitionBuilder.php index 91e84ab6..b0534999 100644 --- a/src/Column/ColumnDefinitionBuilder.php +++ b/src/Column/ColumnDefinitionBuilder.php @@ -12,19 +12,6 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder { protected const AUTO_INCREMENT_KEYWORD = 'AUTOINCREMENT'; - protected const CLAUSES = [ - 'type', - 'primary_key', - 'auto_increment', - 'unique', - 'not_null', - 'default', - 'check', - 'references', - 'extra', - 'comment', - ]; - protected const TYPES_WITH_SIZE = [ 'bit', 'tinyint', @@ -55,6 +42,20 @@ final class ColumnDefinitionBuilder extends AbstractColumnDefinitionBuilder 'numeric', ]; + public function build(ColumnSchemaInterface $column): string + { + return $this->buildType($column) + . $this->buildPrimaryKey($column) + . $this->buildAutoIncrement($column) + . $this->buildUnique($column) + . $this->buildNotNull($column) + . $this->buildDefault($column) + . $this->buildCheck($column) + . $this->buildReferences($column) + . $this->buildExtra($column) + . $this->buildComment($column); + } + protected function buildComment(ColumnSchemaInterface $column): string { $comment = $column->getComment();