feat: add referral_code
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
// When the referral free-month subscription was granted (null = not yet).
|
||||
if (!Schema::hasColumn('users', 'referral_subscription_granted_at')) {
|
||||
$table->timestamp('referral_subscription_granted_at')->nullable()->after('referred_by');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('users', 'referral_subscription_granted_at')) {
|
||||
$table->dropColumn('referral_subscription_granted_at');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user