adrema/database/migrations/2021_11_18_001427_create_co...

44 lines
1.1 KiB
PHP
Raw Permalink 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()
{
2023-06-29 12:57:06 +02:00
Schema::dropIfExists('course_members');
2021-11-18 01:54:27 +01:00
Schema::dropIfExists('courses');
}
}