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

Merge branch 'journal' into timetable

# Conflicts:
#	app/Http/Controllers/Auth/LoginController.php
#	app/Http/Controllers/Auth/RegisterController.php
#	app/Http/Controllers/TimetableController.php
#	app/Models/SchoolClass.php
#	app/Models/User.php
#	composer.lock
This commit is contained in:
2020-12-16 23:14:06 +07:00
49 changed files with 2078 additions and 330 deletions

View File

@@ -13,7 +13,7 @@ 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');
@@ -23,7 +23,7 @@ class CreateBankTaskFilesTable extends Migration
$table->unsignedInteger('banktask_id');
$table->foreign('banktask_id')
->references('id')->on('bank_tasks')
->onDelete('no action');
->onDelete('cascade');
});
}
@@ -35,6 +35,6 @@ class CreateBankTaskFilesTable extends Migration
*/
public function down()
{
Schema::dropIfExists('bank_tasks_files');
Schema::dropIfExists('bank_task_files');
}
}

View File

@@ -0,0 +1,43 @@
<?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->unsignedInteger('banktask_id');
$table->timestamp('deadline')->nullable();
$table->unsignedInteger('teacher_id')->nullable();
$table->unsignedInteger('class_id')->nullable();
$table->timestamps();
$table->foreign('banktask_id')->references('id')->on('bank_tasks')
->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');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAnswersToTaskTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('answers_to_task', function (Blueprint $table) {
$table->id();
$table->text('description')->nullable();
$table->smallInteger('mark')->nullable();
$table->text('comment_by_teacher')->nullable();
$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')
->onDelete('set null');
$table->foreign('student_id')->references('id')->on('students');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('answers_to_task');
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTaskFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('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('task_id');
$table->unsignedInteger('user_id');
$table->foreign('task_id')->references('id')->on('tasks')
->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('task_files');
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJournalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('journals', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('teacher_id');
$table->unsignedBigInteger('student_id');
$table->unsignedBigInteger('subject_id');
$table->unsignedBigInteger('score');
$table->string('comment')->nullable();
$table->timestamps();
$table->foreign('subject_id')
->references('id')->on('subjects');
$table->foreign('teacher_id')
->references('id')->on('teachers')
->onDelete('cascade');
$table->foreign('student_id')
->references('id')->on('students')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('journals');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description');
$table->string('photo_uri')->nullable();
$table->unsignedInteger('headteacher_id');
$table->foreign('headteacher_id')->references('id')->on('head_teachers');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news_files', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('type');
$table->string('extension');
$table->timestamps();
$table->unsignedInteger('news_id');
$table->foreign('news_id')
->references('id')->on('news')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news');
}
}