Skip to content

Commit

Permalink
Update according changes in ColumnSchemaInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Sep 20, 2024
1 parent e7d2f0b commit 7773c6e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 61 deletions.
5 changes: 2 additions & 3 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
* dflt_value:string|null,
* pk:string,
* size?: int,
* precision?: int,
* scale?: int,
* }
*/
Expand Down Expand Up @@ -346,7 +345,7 @@ protected function findColumns(TableSchemaInterface $table): bool

if ($column !== null && !strncasecmp($column->getDbType() ?? '', 'int', 3)) {
$table->sequenceName('');
$column->autoIncrement(true);
$column->autoIncrement();
}

return !empty($columns);
Expand Down Expand Up @@ -443,7 +442,7 @@ private function loadColumnSchema(array $info): ColumnSchemaInterface
$dbType = strtolower($info['type']);
$column = $columnFactory->fromDefinition($dbType, ['name' => $info['name']]);
$column->dbType($dbType);
$column->allowNull(!$info['notnull']);
$column->notNull((bool) $info['notnull']);
$column->primaryKey((bool) $info['pk']);
$column->defaultValue($this->normalizeDefaultValue($info['dflt_value'], $column));

Expand Down
Loading

0 comments on commit 7773c6e

Please sign in to comment.