fix bug
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user