Skip to content

Commit

Permalink
Use different database if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfensdrfer committed Dec 11, 2018
1 parent d2a9828 commit c62d0a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/migrations/2017_02_12_102845_create_logger_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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'));
}
}
4 changes: 2 additions & 2 deletions src/migrations/2018_12_02_102846_update_text_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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();
Expand Down

0 comments on commit c62d0a1

Please sign in to comment.