Skip to content

Commit

Permalink
Add return type to migration methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamid Afghan authored Sep 9, 2023
1 parent 5f7e018 commit 17b0614
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use Illuminate\Database\Migrations\Migration;

class AddBatchUuidColumnToActivityLogTable extends Migration
{
public function up()
public function up(): void
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
}

public function down()
public function down(): void
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('batch_uuid');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use Illuminate\Database\Migrations\Migration;

class AddEventColumnToActivityLogTable extends Migration
{
public function up()
public function up(): void
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->string('event')->nullable()->after('subject_type');
});
}

public function down()
public function down(): void
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('event');
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/create_activity_log_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Illuminate\Database\Migrations\Migration;

class CreateActivityLogTable extends Migration
{
public function up()
public function up(): void
{
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
Expand All @@ -20,7 +20,7 @@ class CreateActivityLogTable extends Migration
});
}

public function down()
public function down(): void
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
Expand Down

0 comments on commit 17b0614

Please sign in to comment.