Skip to content

Make:entity: Add question about unsigned integer #1661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
} elseif ('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',
// Nullable
'y',
'createdAt',
// use default datetime
'',
Expand Down
Loading