Files
exchange-2.0/database/migrations/2025_11_16_190751_create_affiliates_table.php
T
Edmond Lang 30ed77f304 Merge branch 'affiliate-program' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into vapor/production
# Conflicts:
#	resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue
#	routes/api.php
2026-01-26 00:13:10 +08:00

44 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAffiliatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('affiliates', function (Blueprint $table) {
$table->id();
$table->string('code')->unique();
$table->string('campaign_name');
$table->text('campaign_description')->nullable();
$table->boolean('is_active')->default(true);
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedInteger('clicks_count')->default(0);
$table->unsignedInteger('registrations_count')->default(0);
$table->unsignedInteger('orders_count')->default(0);
$table->timestamps();
$table->softDeletes();
$table->index('code');
$table->index('is_active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('affiliates');
}
}