2020-04-12 00:26:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreateMembershipsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('memberships', function (Blueprint $table) {
|
2021-04-10 02:57:10 +02:00
|
|
|
$table->id();
|
|
|
|
$table->integer('activity_id');
|
|
|
|
$table->integer('group_id')->nullable();
|
|
|
|
$table->integer('member_id');
|
|
|
|
$table->integer('nami_id')->nullable();
|
2020-04-12 00:26:44 +02:00
|
|
|
$table->timestamps();
|
2021-04-10 02:57:10 +02:00
|
|
|
$table->unique(['activity_id', 'group_id', 'member_id', 'nami_id']);
|
2020-04-12 00:26:44 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('memberships');
|
|
|
|
}
|
|
|
|
}
|