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

Merge branch 'news' into journal

# Conflicts:
#	app/Http/Controllers/Users/TeacherController.php
This commit is contained in:
2020-12-16 22:47:08 +07:00
21 changed files with 654 additions and 271 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

@@ -16,7 +16,7 @@ class CreateTimetablesTable extends Migration
Schema::create('timetables', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('class_id');
$table->unsignedInteger('teacher_id');
$table->unsignedInteger('teacher_id')->nullable();
$table->unsignedInteger('subject_id');
$table->date('date');
$table->time('time_start');

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');
}
}