41 lines
1.7 KiB
PHP
41 lines
1.7 KiB
PHP
<?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::create('incentives', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
|
|
$table->string('name', 255);
|
|
$table->string('slug', 255)->unique();
|
|
$table->text('description')->nullable();
|
|
$table->string('image', 255)->nullable()->comment('Statisches Bild Dateiname');
|
|
$table->text('terms')->nullable()->comment('Teilnahmebedingungen');
|
|
|
|
$table->date('qualification_start')->comment('Beginn Qualifikationszeitraum');
|
|
$table->date('qualification_end')->comment('Ende Qualifikationszeitraum');
|
|
$table->date('calculation_end')->comment('Ende Punkteberechnung (inkl. Verlaengerung)');
|
|
|
|
$table->unsignedInteger('points_partner_onetime')->default(600)->comment('Einmalpunkte pro Neupartner');
|
|
$table->unsignedInteger('points_abo_onetime')->default(400)->comment('Einmalpunkte pro Kundenabo');
|
|
$table->unsignedInteger('min_direct_partners')->default(4)->comment('Mindestanzahl direkte Teampartner');
|
|
$table->unsignedInteger('min_customer_abos')->default(6)->comment('Mindestanzahl Kundenabos');
|
|
$table->unsignedInteger('max_winners')->default(30)->comment('Maximale Anzahl Gewinner');
|
|
|
|
$table->unsignedTinyInteger('status')->default(0)->index()->comment('0=draft, 1=active, 2=closed');
|
|
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('incentives');
|
|
}
|
|
};
|