Skip to content

Commit bfe6a9c

Browse files
Tofandelifox
authored andcommitted
Ask to create the migrations
1 parent 57e0344 commit bfe6a9c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Commands/Traits/HandlesPotentialBreakingChangesWarnings.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,32 @@ public function warnAboutNewPositionColumns(): void
2828

2929
$this->warn("⚠️ Twill 3.5.0 introduced 2 new database migrations to fix a bug with the medias and files fields position management, make sure to add them to your project.\n");
3030

31-
if ($this->ask('Would you like to add the migration to your project?')) {
31+
if ($this->confirm('Would you like to add the migrations to your project?')) {
3232
if (! $mediablesHasPosition) {
3333
copy(
3434
__DIR__ . '/../../../migrations/default/2020_02_09_000015_add_position_to_twill_default_mediables_table.php',
35-
database_path() . '/migrations/' . date('Y_m_d_His') . '_add_position_to_twill_default_mediables_table.php'
35+
$added = database_path() . '/migrations/' . date('Y_m_d_His') . '_add_position_to_twill_default_mediables_table.php'
3636
);
37+
$this->info('Added migration ' . str_replace(base_path(), '', $added));
3738
}
3839
if (! $fileablesHasPosition) {
3940
copy(
4041
__DIR__ . '/../../../migrations/default/2020_02_09_000016_add_position_to_twill_default_fileables_table.php',
41-
database_path() . '/migrations/' . date('Y_m_d_His') . '_add_position_to_twill_default_fileables_table.php'
42+
$added = database_path() . '/migrations/' . date('Y_m_d_His') . '_add_position_to_twill_default_fileables_table.php'
4243
);
44+
$this->info('Added migration ' . str_replace(base_path(), '', $added));
4345
}
46+
$this->newLine();
47+
$this->info("Don't forget to run <warning>php artisan migrate</warning>");
4448
} else {
49+
$this->info('You can find the migrations source there:');
4550
if (! $mediablesHasPosition) {
46-
$this->info('You can find the migration source there:');
4751
$this->info('🔗 https://raw.githubusercontent.com/area17/twill/refs/tags/3.5.0/migrations/default/2020_02_09_000015_add_position_to_twill_default_mediables_table.php');
4852
}
4953
if (! $fileablesHasPosition) {
50-
$this->info('You can find the migration source there:');
5154
$this->info('🔗 https://raw.githubusercontent.com/area17/twill/refs/tags/3.5.0/migrations/default/2020_02_09_000016_add_position_to_twill_default_fileables_table.php');
5255
}
5356
}
57+
$this->info('');
5458
}
5559
}

0 commit comments

Comments
 (0)