Skip to content

Commit 1c77c8a

Browse files
committed
Updated migration table name
1 parent ac94515 commit 1c77c8a

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ MySQL driver for Laravel Monolog.
88
composer require markhilton/monolog-mysql
99
~~~
1010

11-
You'll then need to run `composer install` to download it and have the autoloader updated.
12-
1311
Open up `config/app.php` and find the `providers` key.
1412

1513
~~~

src/Logger/Laravel/migrations/2016_03_01_000000_create_logs_table.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ class CreateLogsTable extends Migration
1111
*/
1212
public function up()
1313
{
14-
Schema::create('logs', function($table)
15-
{
16-
$table->engine = 'InnoDB';
14+
Schema::create(
15+
env('DB_LOG_TABLE', 'logs'),
16+
function ($table) {
17+
$table->engine = 'InnoDB';
1718

18-
$table->bigIncrements('id');
19-
$table->string('instance')->index();
20-
$table->string('channel')->index();
21-
$table->string('level')->index();
22-
$table->string('level_name');
23-
$table->text('message');
24-
$table->text('context');
19+
$table->bigIncrements('id');
20+
$table->string('instance')->index();
21+
$table->string('channel')->index();
22+
$table->string('level')->index();
23+
$table->string('level_name');
24+
$table->text('message');
25+
$table->text('context');
2526

26-
$table->integer('remote_addr')->nullable()->unsigned();
27-
$table->string('user_agent')->nullable();
28-
$table->integer('created_by')->nullable()->index();
27+
$table->integer('remote_addr')->nullable()->unsigned();
28+
$table->string('user_agent')->nullable();
29+
$table->integer('created_by')->nullable()->index();
2930

30-
$table->dateTime('created_at');
31-
});
31+
$table->dateTime('created_at');
32+
}
33+
);
3234
}
3335

3436
/**
@@ -38,6 +40,6 @@ public function up()
3840
*/
3941
public function down()
4042
{
41-
Schema::drop('logs');
43+
Schema::drop(env('DB_LOG_TABLE', 'logs'));
4244
}
4345
}

0 commit comments

Comments
 (0)