mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 10:54:31 +00:00
модуль Задания(почти готов)
This commit is contained in:
45
database/migrations/2020_12_03_172010_create_tasks_table.php
Normal file
45
database/migrations/2020_12_03_172010_create_tasks_table.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTasksTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tasks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name',255);
|
||||
$table->text('description')->nullable();
|
||||
$table->dateTime('deadline')->nullable();
|
||||
$table->unsignedInteger('teacher_id')->nullable();
|
||||
$table->unsignedInteger('class_id')->nullable();
|
||||
$table->timestamps();
|
||||
$table->integer('subject_id');
|
||||
|
||||
$table->foreign('subject_id')->references('id')->on('subjects')
|
||||
->onDelete('set null');
|
||||
|
||||
// $table->foreign('class_id')->references('id')->on('school_classes')
|
||||
// ->onDelete('cascade');
|
||||
// $table->foreign('teacher_id')->references('id')->on('teachers')
|
||||
// ->onDelete('set null');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tasks');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user