Роли, переделывание отчета, изменение на главной странице
This commit is contained in:
@@ -11,6 +11,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('roles', function (Blueprint $table) {
|
||||
$table->id('role_id');
|
||||
$table->string('name');
|
||||
$table->string('slug');
|
||||
$table->boolean('is_active')->default(true);
|
||||
});
|
||||
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
@@ -23,6 +30,14 @@ return new class extends Migration
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('user_roles', function (Blueprint $table) {
|
||||
$table->id('user_role_id');
|
||||
$table->foreignIdFor(\App\Models\User::class, 'rf_user_id');
|
||||
$table->foreignIdFor(\App\Models\Role::class, 'rf_role_id');
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->boolean('is_default')->default(false);
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('login')->primary();
|
||||
$table->string('token');
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::create('reports', function (Blueprint $table) {
|
||||
$table->id('report_id');
|
||||
$table->date('created_at');
|
||||
$table->date('sent_at')->nullable();
|
||||
$table->dateTime('sent_at')->nullable();
|
||||
$table->foreignIdFor(\App\Models\Department::class, 'rf_department_id')->default(1);
|
||||
$table->foreignIdFor(\App\Models\User::class, 'rf_user_id')->nullable();
|
||||
});
|
||||
|
||||
@@ -14,13 +14,13 @@ return new class extends Migration
|
||||
Schema::create('metrika_results', function (Blueprint $table) {
|
||||
$table->id('metrika_result_id')
|
||||
->comment('Идентификатор результата метрики');
|
||||
$table->foreignIdFor(\App\Models\MetrikaItem::class, 'rf_metrika_item_id')
|
||||
->comment('Идентификатор метрики')
|
||||
->constrained();
|
||||
$table->foreignIdFor(\App\Models\Report::class, 'rf_report_id')
|
||||
->comment('Идентификатор отчета')
|
||||
->constrained()
|
||||
->cascadeOnDelete();
|
||||
$table->foreignIdFor(\App\Models\MetrikaGroup::class, 'rf_metrika_group_id')
|
||||
->comment('Идентификатор группы метрики')
|
||||
->constrained();
|
||||
$table->text('value');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ return new class extends Migration
|
||||
$table->foreignIdFor(\App\Models\MetrikaItem::class, 'rf_metrika_item_id')
|
||||
->comment('Идентификатор метрики')
|
||||
->constrained();
|
||||
$table->foreignIdFor(\App\Models\Report::class, 'rf_report_id')
|
||||
->comment('Идентификатор отчета')
|
||||
->constrained();
|
||||
$table->text('value');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('department_types', function (Blueprint $table) {
|
||||
$table->id('department_type_id');
|
||||
$table->string('name_full');
|
||||
$table->string('name_short')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('department_types');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('departments', function (Blueprint $table) {
|
||||
$table->id('department_id');
|
||||
$table->string('name_full');
|
||||
$table->string('name_short')->nullable();
|
||||
$table->unsignedBigInteger('rf_mis_department_id')->nullable();
|
||||
$table->foreignIdFor(\App\Models\DepartmentType::class, 'rf_department_type')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('departments');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('department_metrika_defaults', function (Blueprint $table) {
|
||||
$table->id('department_metrika_default_id');
|
||||
$table->foreignIdFor(\App\Models\Department::class, 'rf_department_id');
|
||||
$table->foreignIdFor(\App\Models\MetrikaItem::class, 'rf_metrika_item_id');
|
||||
$table->string('value');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('department_metrika_defaults');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('observation_patients', function (Blueprint $table) {
|
||||
$table->id('observation_patient_id');
|
||||
$table->unsignedBigInteger('rf_medicalhistory_id')->nullable();
|
||||
$table->unsignedBigInteger('rf_mkab_id')->nullable();
|
||||
$table->foreignIdFor(\App\Models\Department::class, 'rf_department_id');
|
||||
$table->foreignIdFor(\App\Models\Report::class, 'rf_report_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('observation_patients');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user