ldc-gen-game-web/database/migrations/2020_10_28_091935_create_participations.php
Jérémy Munsch 1af96897f3
- Squash migration
- Normalize Model names and sql tables
- PHPCS clean up
- Change analytics form + field
2022-01-11 12:46:10 +01:00

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('user_id')->constrained('users');
$table->foreignId('code_unique_id')->constrained('codes');
$table->foreignId('code_ean_id')->nullable()->constrained('code_eans');
$table->foreignId('reduction_id')->nullable()->constrained('reductions');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('participations');
}
}