@@ -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