Skip to content

Commit 18f96b5

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

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Commands/Traits/HandlesPotentialBreakingChangesWarnings.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,20 @@ 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
}
4446
} else {
4547
if (!$mediablesHasPosition) {
@@ -51,5 +53,6 @@ public function warnAboutNewPositionColumns(): void
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)