2019-11-27 00:46:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateClassesTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('classes', function (Blueprint $table) {
|
|
|
|
$table->bigIncrements('id');
|
|
|
|
$table->integer('subject_id');
|
|
|
|
$table->date('date');
|
|
|
|
$table->timestamps();
|
2019-12-01 19:31:49 +01:00
|
|
|
$table->foreign('subject_id')->references('id')->on('subjects')->onDelete('cascade');
|
2019-11-27 00:46:00 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('classes');
|
|
|
|
}
|
|
|
|
}
|