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:
ashen-1-dev
2020-12-10 21:14:51 +07:00
parent ba578e9fdf
commit dda49ceb17
23 changed files with 219 additions and 94 deletions

View File

@@ -13,17 +13,18 @@ class CreateBankTaskFilesTable extends Migration
*/
public function up()
{
Schema::create('bank_tasks_files', function (Blueprint $table) {
Schema::create('bank_task_files', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('type');
$table->string('extension');
$table->string('url', 400);
$table->timestamps();
$table->unsignedInteger('banktask_id');
$table->foreign('banktask_id')
->references('id')->on('bank_tasks')
->onDelete('no action');
->onDelete('cascade')->onUpdate('no action');
});
}

View File

@@ -15,15 +15,13 @@ class CreateTasksTable extends Migration
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->string('name',255);
$table->text('description')->nullable();
$table->dateTime('deadline')->nullable();
$table->unsignedInteger('banktask_id');
$table->timestamp('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')
$table->foreign('banktask_id')->references('id')->on('bank_tasks')
->onDelete('set null');
// $table->foreign('class_id')->references('id')->on('school_classes')

View File

@@ -18,9 +18,10 @@ class CreateAnswersToTaskTable extends Migration
$table->text('description')->nullable();
$table->smallInteger('mark')->nullable();
$table->text('comment_by_teacher')->nullable();
$table->boolean('checked')->default('false');
$table->boolean('checked')->default('0');
$table->unsignedInteger('task_id');
$table->unsignedInteger('student_id');
$table->boolean('review')->default('0');
$table->timestamps();
$table->foreign('task_id')->references('id')->on('tasks')

View File

@@ -18,7 +18,6 @@ class CreateTaskFilesTable extends Migration
$table->string('name');
$table->string('type');
$table->string('extension');
$table->boolean('add_by_teacher')->default('0');
$table->string('url', 400);
$table->timestamps();
$table->unsignedInteger('task_id');