diff --git a/src/ColumnShouldBeIgnored.php b/src/ColumnShouldBeIgnored.php index 564481f..473fca3 100644 --- a/src/ColumnShouldBeIgnored.php +++ b/src/ColumnShouldBeIgnored.php @@ -12,6 +12,11 @@ public function __invoke(Column $column): bool return true; } + // enum + if ($column->getType()->getName() === 'string' && $column->getLength() === 0) { + return true; + } + if ($column->getName() === 'deleted_at') { return true; } diff --git a/src/FactoryGenerator.php b/src/FactoryGenerator.php index ed36da2..54ed542 100644 --- a/src/FactoryGenerator.php +++ b/src/FactoryGenerator.php @@ -69,9 +69,13 @@ public function generate(Model $model): string protected function table(Model $model): Table { - return $this->connection - ->getDoctrineSchemaManager() - ->listTableDetails($model->getTable()); + $schemaManager = $this->connection + ->getDoctrineSchemaManager(); + + $schemaManager->getDatabasePlatform() + ->registerDoctrineTypeMapping('enum', 'string'); + + return $schemaManager->listTableDetails($model->getTable()); } protected function columns(Table $table): array