Skip to content

Commit

Permalink
require create or update option when table or model option is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Oct 26, 2023
1 parent 6eb7b07 commit 614354e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/system/console/CreateMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ protected function prepareVars(): array
throw new InvalidArgumentException('The table or model options are required when using the create or update options');
}

if (($table || $model) && !in_array($scaffold, ['create', 'update'])) {
throw new InvalidArgumentException('One of create or update option is required when using the model or table options');
}

$this->stubs = $this->migrationScaffolds[$scaffold];

if (!empty($this->option('for-version'))) {
Expand Down

0 comments on commit 614354e

Please sign in to comment.