Add warning about database data to database settings command (#612)

This commit is contained in:
Boy132 2024-10-08 23:45:50 +02:00 committed by GitHub
parent b003404aea
commit a946669dc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,6 +42,13 @@ class DatabaseSettingsCommand extends Command
*/ */
public function handle(): int public function handle(): int
{ {
$this->error('Changing the database driver will NOT move any database data!');
$this->error('Please make sure you made a database backup first!');
$this->error('After changing the driver you will have to manually move the old data to the new database.');
if (!$this->confirm('Do you want to continue?')) {
return 1;
}
$selected = config('database.default', 'sqlite'); $selected = config('database.default', 'sqlite');
$this->variables['DB_CONNECTION'] = $this->option('driver') ?? $this->choice( $this->variables['DB_CONNECTION'] = $this->option('driver') ?? $this->choice(
'Database Driver', 'Database Driver',