mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 02:44:31 +00:00
общий код
This commit is contained in:
@@ -17,15 +17,11 @@ class CreateTeachersTable extends Migration
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->string('photo')->nullable();
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('second_name')->nullable();
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('date_of_birth')->nullable();
|
||||
$table->string('phone_number')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('passport')->nullable();
|
||||
$table->string('qualification')->nullable();
|
||||
$table->unsignedTinyInteger('experience')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('surname')->nullable();
|
||||
$table->string('patronymic')->nullable();
|
||||
$table->string('specialization')->nullable();
|
||||
$table->string('information_about_me')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateSchoolClassesTable extends Migration
|
||||
$table->id();
|
||||
$table->unsignedTinyInteger('number');
|
||||
$table->string('letter', 1);
|
||||
$table->unsignedTinyInteger('count_students');
|
||||
$table->unsignedTinyInteger('count_students')->default(0);
|
||||
$table->string('profile');
|
||||
$table->unsignedInteger('classroom_teacher')->nullable();
|
||||
$table->timestamps();
|
||||
@@ -25,6 +25,8 @@ class CreateSchoolClassesTable extends Migration
|
||||
$table->foreign('classroom_teacher')
|
||||
->references('id')->on('teachers')
|
||||
->onDelete('set null');
|
||||
|
||||
$table->unique(['number', 'letter']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,15 +17,10 @@ class CreateParentsTable extends Migration
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->string('photo')->nullable();
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('second_name')->nullable();
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('date_of_birth')->nullable();
|
||||
$table->string('phone_number')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('passport')->nullable();
|
||||
$table->string('place_of_work')->nullable();
|
||||
$table->string('position_at_work')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('surname')->nullable();
|
||||
$table->string('patronymic')->nullable();
|
||||
$table->string('information_about_me')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')
|
||||
|
||||
@@ -17,14 +17,11 @@ class CreateStudentsTable extends Migration
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->string('photo')->nullable();
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('second_name')->nullable();
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('date_of_birth')->nullable();
|
||||
$table->string('phone_number')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('passport_or_certificate')->nullable();
|
||||
$table->unsignedBigInteger('class_id')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('surname')->nullable();
|
||||
$table->string('patronymic')->nullable();
|
||||
$table->unsignedInteger('class_id')->nullable();
|
||||
$table->string('information_about_me')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')
|
||||
|
||||
@@ -17,14 +17,10 @@ class CreateHeadTeachersTable extends Migration
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->string('photo')->nullable();
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('second_name')->nullable();
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('date_of_birth')->nullable();
|
||||
$table->string('phone_number')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('passport')->nullable();
|
||||
$table->string('activity')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('surname')->nullable();
|
||||
$table->string('patronymic')->nullable();
|
||||
$table->string('information_about_me')->nullable();
|
||||
$table->unsignedTinyInteger('experience')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateThemesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('themes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('variant');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('themes');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSubjectsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('subjects', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('subjects');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBankTasksTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('bank_tasks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('short_description');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('author', 128)->nullable();
|
||||
$table->unsignedInteger('theme_id')->nullable();
|
||||
$table->unsignedInteger('subject_id');
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
|
||||
$table->foreign('theme_id')
|
||||
->references('id')->on('themes')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('subject_id')
|
||||
->references('id')->on('subjects')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bank_tasks');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBankTaskFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('bank_tasks_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');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bank_tasks_files');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user