Skip to content

Commit b87dfb9

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

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Commands/Traits/HandlesPotentialBreakingChangesWarnings.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,30 @@ 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 {
47+
$this->info("You can find the migrations source there:");
4548
if (!$mediablesHasPosition) {
46-
$this->info("You can find the migration source there:");
4749
$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");
4850
}
4951
if (!$fileablesHasPosition) {
50-
$this->info("You can find the migration source there:");
5152
$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");
5253
}
5354
}
55+
$this->info('');
5456
}
5557
}

0 commit comments

Comments
 (0)