ldc-gen-game-web/database/migrations/2023_08_22_091935_create_participations.php

39 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateParticipations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('participations', function (Blueprint $table) {
$table->id();
$table->string('ip');
$table->string('sticker')->nullable();
$table->string('ticket')->nullable();
$table->string('barcode')->nullable();
$table->foreignId('customer_id')->constrained('customers');
$table->foreignId('code_unique_id')->constrained('codes');
$table->foreignId('product_id')->nullable()->constrained('products');
$table->foreignId('reduction_id')->nullable()->constrained('reductions');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('participations');
}
}