-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from balajidharma/2.x-Changes
2.x changes
- Loading branch information
Showing
4 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
database/migrations/2024_12_08_175000_create_activity_log_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateActivityLogTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) { | ||
$table->bigIncrements('id'); | ||
$table->string('log_name')->nullable(); | ||
$table->text('description'); | ||
$table->nullableMorphs('subject', 'subject'); | ||
$table->nullableMorphs('causer', 'causer'); | ||
$table->json('properties')->nullable(); | ||
$table->timestamps(); | ||
$table->index('log_name'); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name')); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
database/migrations/2024_12_08_175001_add_event_column_to_activity_log_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddEventColumnToActivityLogTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { | ||
$table->string('event')->nullable()->after('subject_type'); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { | ||
$table->dropColumn('event'); | ||
}); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
database/migrations/2024_12_08_175002_add_batch_uuid_column_to_activity_log_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddBatchUuidColumnToActivityLogTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { | ||
$table->uuid('batch_uuid')->nullable()->after('properties'); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) { | ||
$table->dropColumn('batch_uuid'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters