This commit is contained in:
2026-06-06 17:05:39 +03:30
parent 5b36f2847f
commit 60ddb9d78c
8 changed files with 204 additions and 5 deletions
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTotalReferralsToCustomersTable extends Migration
{
public function up()
{
if (Schema::hasColumn('customers', 'total_referrals')) {
return;
}
Schema::table('customers', function (Blueprint $table) {
$table->unsignedInteger('total_referrals')->default(0)->after('referral_to_id');
});
}
public function down()
{
if (!Schema::hasColumn('customers', 'total_referrals')) {
return;
}
Schema::table('customers', function (Blueprint $table) {
$table->dropColumn('total_referrals');
});
}
}