Skip to content

Commit

Permalink
fix entity gen id error
Browse files Browse the repository at this point in the history
  • Loading branch information
sakuraovq committed Feb 4, 2020
1 parent 563c493 commit e437d36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/devtool/src/Model/Logic/EntityLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ private function generateEntity(
output()->writeln(' Quit, Bye!');
return;
}
if ($fileExists && !$isConfirm && !ConsoleHelper::confirm(" entity $file already exists, Ensure continue?",
if ($fileExists && !$isConfirm
&& !ConsoleHelper::confirm(" entity $file already exists, Ensure continue?",
false)
) {
output()->writeln(' Quit, Bye!');
Expand Down Expand Up @@ -192,7 +193,7 @@ private function generateProperties(array $colSchema, string $tplDir): string

// id
$id = '*';
if (!empty($colSchema['key']) && !$this->readyGenerateId) {
if (!empty($colSchema['key']) && !$this->readyGenerateId && $colSchema['key'] === 'PRI') {
// Is auto increment
$auto = $colSchema['extra'] && strpos($colSchema['extra'], 'auto_increment') !== false ? '' :
'incrementing=false';
Expand Down

1 comment on commit e437d36

@dcdebug
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good

Please sign in to comment.