ldc-gen-game-web/database/migrations/2023_08_22_091935_create_participations.php
2023-12-13 15:48:18 +01:00

54 lines
1.9 KiB
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.
*
* @return void
*/
public function up()
{
Schema::create('participations', function (Blueprint $table) {
$table->id();
$table->string('ip')->comment('Adresse ip de la participation');
$table->string('sticker')->nullable()->comment('Si gagnant, fichier image du sticker utilisé');
$table->string('ticket')->nullable()
->comment('Si gagnant, fichier image du ticket de caisse prouvant l\'achat du produit stické');
$table->string('barcode')->nullable()
->comment('Si gagnant, fichier image du code-barres du produit acheté');
$table->text('comment')->default('')->comment('Si gagnant, Commentaire des gestionnaires du jeu');
$table->boolean('prize_sent')->default(0)->comment('Si gagnant, alors est-ce-que le lot à été envoyé ?');
// * RELATIONSHIPS
$table->foreignId('customer_id')->comment('Customer participant')
->constrained('customers');
$table->foreignId('code_unique_id')->comment('Code unique utilisé')
->constrained('codes');
$table->foreignId('product_id')->nullable()
->comment('Si code EAN activés, Produit porteur de l\'offre (code ean indiqué)')
->constrained('products');
$table->foreignId('discount_id')->nullable()
->comment('Bon de réduction gagné')->constrained('discounts');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('participations');
}
};