1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 10:54:31 +00:00

исправление ошибок

This commit is contained in:
nikden13
2020-12-08 16:45:27 +07:00
parent 45bec16c7f
commit 5b0ba96adf
7 changed files with 88 additions and 24 deletions

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAcademicPlansTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('academic_plans', function (Blueprint $table) {
$table->unsignedInteger('subject_id');
$table->unsignedInteger('class_id');
$table->unsignedInteger('hours_per_week');
$table->unsignedInteger('hours_per_year');
$table->timestamps();
$table->foreign('subject_id')
->references('id')->on('subjects')
->onDelete('cascade');
$table->foreign('class_id')
->references('id')->on('school_classes')
->onDelete('cascade');
$table->primary(['subject_id', 'class_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('academic_plans');
}
}