First Commit
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Capsule\Manager as Capsule;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAffiliatesTable
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!Capsule::schema()->hasTable('affiliates')) {
|
||||
Capsule::schema()->create('affiliates', function (Blueprint $table) {
|
||||
$table->bigIncrements('affiliates_id');
|
||||
$table->string('affiliates_code')->unique();
|
||||
$table->string('affiliates_name');
|
||||
$table->string('affiliates_email')->unique();
|
||||
$table->string('affiliates_phone')->nullable();
|
||||
$table->text('affiliates_address')->nullable();
|
||||
$table->string('affiliates_website')->nullable();
|
||||
$table->decimal('affiliates_commission_rate', 5, 2)->default(10.00);
|
||||
$table->decimal('affiliates_total_earned', 12, 2)->default(0.00);
|
||||
$table->decimal('affiliates_total_paid', 12, 2)->default(0.00);
|
||||
$table->enum('affiliates_status', ['active', 'pending', 'suspended'])->default('pending');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Capsule::schema()->dropIfExists('affiliates');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user