| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateTwillActivityLogTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | */ |
||
| 12 | public function up() |
||
| 13 | { |
||
| 14 | if (!Schema::hasTable(config('activitylog.table_name'))) { |
||
| 15 | Schema::create(config('activitylog.table_name'), function (Blueprint $table) { |
||
| 16 | $table->increments('id'); |
||
| 17 | $table->string('log_name')->nullable(); |
||
| 18 | $table->text('description'); |
||
| 19 | $table->integer('subject_id')->nullable(); |
||
| 20 | $table->string('subject_type')->nullable(); |
||
| 21 | $table->integer('causer_id')->nullable(); |
||
| 22 | $table->string('causer_type')->nullable(); |
||
| 23 | $table->text('properties')->nullable(); |
||
| 24 | $table->timestamps(); |
||
| 25 | |||
| 26 | $table->index('log_name'); |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Reverse the migrations. |
||
| 33 | */ |
||
| 34 | public function down() |
||
| 35 | { |
||
| 36 | Schema::dropIfExists(config('activitylog.table_name')); |
||
| 37 | } |
||
| 39 |