Skip to content

Commit f535be7

Browse files
committed
Ask to create the migrations
1 parent 3fb8141 commit f535be7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Commands/Traits/HandlesPotentialBreakingChangesWarnings.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,31 @@ 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 migration 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->info("Don't forget to run `php artisan migrate`");
4447
} else {
48+
$this->info("You can find the migrations source there:");
4549
if (!$mediablesHasPosition) {
46-
$this->info("You can find the migration source there:");
4750
$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");
4851
}
4952
if (!$fileablesHasPosition) {
50-
$this->info("You can find the migration source there:");
5153
$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");
5254
}
5355
}
56+
$this->info('');
5457
}
5558
}

0 commit comments

Comments
 (0)