mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 14:33:59 +00:00
30ed77f304
# Conflicts: # resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue # routes/api.php
44 lines
1.2 KiB
PHP
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');
|
|
}
|
|
}
|