adrema/database/migrations/2021_11_18_001427_create_co...

43 lines
1.0 KiB
PHP
Raw Normal View History

2021-11-18 01:54:27 +01:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCoursesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('courses', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('nami_id');
$table->string('name');
});
2022-03-11 20:19:17 +01:00
Schema::create('course_members', function ($table) {
2021-11-20 00:48:42 +01:00
$table->id();
2021-11-18 01:54:27 +01:00
$table->foreignId('member_id')->constrained();
$table->foreignId('course_id')->constrained();
$table->string('organizer');
$table->string('event_name');
$table->unsignedInteger('nami_id');
$table->date('completed_at');
2021-11-20 00:48:42 +01:00
$table->timestamps();
2021-11-18 01:54:27 +01:00
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('courses');
}
}