From c62d0a13d29026575c916bed26343ad048b8bb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Helfensd=C3=B6rfer?= Date: Tue, 11 Dec 2018 10:26:46 +0100 Subject: [PATCH] Use different database if necessary --- src/migrations/2017_02_12_102845_create_logger_table.php | 4 ++-- src/migrations/2018_12_02_102846_update_text_columns.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/migrations/2017_02_12_102845_create_logger_table.php b/src/migrations/2017_02_12_102845_create_logger_table.php index 612a56d..f1679cc 100644 --- a/src/migrations/2017_02_12_102845_create_logger_table.php +++ b/src/migrations/2017_02_12_102845_create_logger_table.php @@ -13,7 +13,7 @@ class CreateLoggerTable extends Migration */ public function up() { - Schema::create(env('LOG_TABLE', 'logs'), function (Blueprint $table) { + Schema::connection(env('LOG_DATABASE', config('database.default')))->create(env('LOG_TABLE', 'logs'), function (Blueprint $table) { $table->bigIncrements('id'); $table->text('message'); @@ -33,6 +33,6 @@ public function up() */ public function down() { - Schema::dropIfExists(env('LOG_TABLE', 'logs')); + Schema::connection(env('LOG_DATABASE', config('database.default')))->dropIfExists(env('LOG_TABLE', 'logs')); } } diff --git a/src/migrations/2018_12_02_102846_update_text_columns.php b/src/migrations/2018_12_02_102846_update_text_columns.php index 9647258..e6e531a 100644 --- a/src/migrations/2018_12_02_102846_update_text_columns.php +++ b/src/migrations/2018_12_02_102846_update_text_columns.php @@ -13,7 +13,7 @@ class UpdateTextColumns extends Migration */ public function up() { - Schema::table(env('LOG_TABLE', 'logs'), function (Blueprint $table) { + Schema::connection(env('LOG_DATABASE', config('database.default')))->table(env('LOG_TABLE', 'logs'), function (Blueprint $table) { $table->longText('message')->change(); $table->longText('context') ->nullable() @@ -29,7 +29,7 @@ public function up() */ public function down() { - Schema::table(env('LOG_TABLE', 'logs'), function (Blueprint $table) { + Schema::connection(env('LOG_DATABASE', config('database.default')))->table(env('LOG_TABLE', 'logs'), function (Blueprint $table) { $table->text('message')->change(); $table->text('context')->change(); $table->text('extra')->change();