Skip to content

Commit

Permalink
Fix migration publishing for update command
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox committed Aug 26, 2019
1 parent faf7c8d commit 9eaedc4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/TwillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,18 @@ private function publishMigration($migration, $publishKey = null)
$migration_file = database_path('migrations/*_' . snake_case($migration) . '.php');
if (empty($files->glob($migration_file))) {
$timestamp = date('Y_m_d_', time()) . (30000 + $this->migrationsCounter);

This comment has been minimized.

Copy link
@yanhao-li

yanhao-li Sep 7, 2019

30000 should be 300000
Missed a digit

$migrationSourcePath = __DIR__ . '/../migrations/' . snake_case($migration) . '.php';
$migrationOutputPath = database_path('migrations/' . $timestamp . '_' . snake_case($migration) . '.php');

$this->publishes([
__DIR__ . '/../migrations/' . snake_case($migration) . '.php' => database_path('migrations/' . $timestamp . '_' . snake_case($migration) . '.php'),
], ['migrations'] + (is_null($publishKey) ? [] : [$publishKey]));
$migrationSourcePath => $migrationOutputPath,
], 'migrations');

if ($publishKey) {
$this->publishes([
$migrationSourcePath => $migrationOutputPath,
], $publishKey);
}
}
}
}
Expand Down

1 comment on commit 9eaedc4

@jeepey
Copy link

@jeepey jeepey commented on 9eaedc4 Sep 20, 2019

Choose a reason for hiding this comment

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

Can you please merge this fix into the 1.2.2 tag? Right now this fails when trying to update to 1.2.2

Please sign in to comment.