Skip to content

Commit

Permalink
Make:entity: Add question about unsigned integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Menelion committed Feb 7, 2025
1 parent dcd2260 commit a80b9d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Maker/MakeEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ private function askForNextField(ConsoleStyle $io, array $fields, string $entity

// set type according to user decision
$classProperty->type = $io->confirm('Can this field store multiple enum values', false) ? 'simple_array' : 'string';
} else if ('integer' === $type) {
$classProperty->options['unsigned'] = $io->confirm('Is this an unsigned integer', false);
}

if ($io->confirm('Can this field be null in the database (nullable)', false)) {
Expand Down
6 changes: 6 additions & 0 deletions tests/Maker/MakeEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ public function getTestDetails(): \Generator
'255', // length
// nullable
'y',
'rating',
'integer',
// Unsigned
'y',
// Not nullable
'n',
'createdAt',
// use default datetime
'',
Expand Down

0 comments on commit a80b9d9

Please sign in to comment.