OwlCyberSecurity - MANAGER
Edit File: 2024_07_13_154223_create_affiliate_key_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Schema::create('affiliate_key', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('user_id'); $table->text('code')->collation('utf8mb4_0900_ai_ci'); $table->unsignedInteger('discount_percent'); $table->binary('is_active')->default('0x30'); $table->timestamp('from'); $table->timestamp('until'); $table->timestamps(); $table->timestamp('deleted_at')->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); $table->index('id', 'PRIMARY')->using('BTREE'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('affiliate_key'); } };