Files
symfonycast.local/database/migrations/2022_08_18_094159_create_course_table.php
2022-08-23 08:09:14 +02:00

39 lines
960 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('courses', function (Blueprint $table) {
$table->id();
$table->integer('course_id')->unique();
$table->text('name');
$table->text('thumbnail');
$table->text('link');
$table->enum('status', ['unfinished', 'upcoming', 'complete']);
$table->integer('numberofchapters');
$table->integer('timeswatched');
$table->dateTime('published_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('courses');
}
};