Skip to content

Commit

Permalink
Separate the migration run from the install command (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvetty authored Aug 6, 2024
1 parent 3de99c9 commit 5b516fa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions krait/src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ public function handle(): int
{
$this->info('Publishing assets...');

$alreadyMigrated = Schema::hasTable('krait_preview_configurations');
$tags = 'krait-config|krait-js';
if ($alreadyMigrated) {
if (Schema::hasTable('krait_preview_configurations')) {
$tags = "$tags|krait-migrations";
}
$this->callSilent('vendor:publish', [
Expand All @@ -50,14 +49,6 @@ public function handle(): int
$this->registerKraitProvider();
$this->components->info('Assets published successfully ✅');

if (! $alreadyMigrated) {
$this->info('Running DB migrations...');
$this->callSilent('migrate');
$this->components->info('Migrations ran successfully ✅');
} else {
$this->info('Skipping the migrations as the table exists...');
}

if (empty($this->option('dev'))) {
$this->installJsPackage();
}
Expand Down

0 comments on commit 5b516fa

Please sign in to comment.