добавляю все изменения проекта на текущий момент

This commit is contained in:
vasya
2026-02-27 18:49:27 +03:00
parent e927910fda
commit 9c35f4e35e
303 changed files with 79434 additions and 2558 deletions
@@ -0,0 +1,32 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
}
};
@@ -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('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('password_reset_tokens');
}
};
@@ -0,0 +1,32 @@
<?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('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('failed_jobs');
}
};
@@ -0,0 +1,33 @@
<?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('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
@@ -0,0 +1,27 @@
<?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('test_data', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('test_data');
}
};
@@ -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::table('test_data', function(Blueprint $table)
{
$table->integer('test_int');
$table->char('test_char', length: 100);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -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('test_form_table', function(Blueprint $table){
$table->id();
$table->timestamps();
$table->char('first_name', 50);
$table->char('last_name', 50);
$table->char('department_name', 50);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::drop('test_form_table');
}
};
@@ -0,0 +1,31 @@
<?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('menu_apps', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('app_name', 100);
$table->string('app_link', 150);
$table->text('app_access');
$table->boolean('isActive');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('menu_apps');
}
};
@@ -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('user_fav_app', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('user_login', 50);
$table->text('fav_apps');
$table->comment('Избранные приложения пользователя из меню Magic');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_fav_app');
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('log_name')->nullable();
$table->text('description');
$table->nullableMorphs('subject', 'subject');
$table->nullableMorphs('causer', 'causer');
$table->json('properties')->nullable();
$table->timestamps();
$table->index('log_name');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
}
@@ -0,0 +1,22 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddEventColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->string('event')->nullable()->after('subject_type');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('event');
});
}
}
@@ -0,0 +1,22 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBatchUuidColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('batch_uuid');
});
}
}
@@ -0,0 +1,26 @@
<?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::table('activity_log', function (Blueprint $table) {
$table->dropColumn(['causer_id', 'causer_type']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
}
};
@@ -0,0 +1,32 @@
<?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::table('users', function (Blueprint $table) {
$table->string('name', 255)->nullable()->default(NULL)->change();
$table->string('email', 255)->nullable()->default(NULL)->change();
$table->string('password', 255)->nullable()->default(NULL)->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('name', 255)->nullable(false)->change();
$table->string('email', 255)->nullable(false)->change();
$table->string('password', 255)->nullable(false)->change();
});
}
};
@@ -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::table('users', function (Blueprint $table) {
$table->string('login', 50)->nullable(false)->comment('Логин пользователя')->after('id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('login');
});
}
};
@@ -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::table('activity_log', function (Blueprint $table) {
$table->string('causer_type', 255)->nullable()->default(NULL);
$table->bigInteger('causer_id')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('activity_log', function (Blueprint $table) {
$table->dropColumn(['causer_id', 'causer_type']);
});
}
};
@@ -0,0 +1,35 @@
<?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('schedule_stat', function(Blueprint $table){
$table->text('module')->comment('Имя модуля');
$table->text('script')->comment('Имя скрипта/класса откуда запускалась задача');
$table->integer('result')->comment('Результат работы скрипта, выраженный в цифре');
$table->text('result_comment')->comment('Пояснение к работе скрипта. Какая работа выполнена?');
$table->timestamps();
$table->unique((['module', 'script']));
$table->comment('Результаты работы скриптов по расписанию');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('schedule_stat');
}
};
@@ -0,0 +1,34 @@
<?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('app_roles', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('app_id')->comment('id приложения (связь с таблицей magic_apps)');
$table->text('app_role')->comment('Роль в приложении');
$table->text('role_access')->nullable()->comment('Кому доступна роль (зависит от драйвера в magic_apps)');
$table->foreign('app_id')->references('id')->on('magic_apps');
$table->comment('Ролевая модель приложений');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('app_roles');
}
};
@@ -0,0 +1,31 @@
<?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::table('menu_apps', function (Blueprint $table) {
$table->rename('magic_apps')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('magic_apps', function (Blueprint $table) {
$table->rename('menu_apps')->change();
});
}
};
@@ -0,0 +1,44 @@
<?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::table('magic_apps', function (Blueprint $table) {
$table->string('access_groups_email')->nullable()->default(NULL)->comment('Доступ к приложениям по почтовым рассылкам')->after('app_link');
$table->string('role_driver', 255)->nullable()->comment('Драйвер определения ролей: по группам AD, по почтовым рассылкам, по логинам. NULL, если ролевая модель не предусмотрена')->after('app_link');
// $table->renameColumn('app_access', 'access_groups_ad');
DB::statement('ALTER TABLE magic_apps CHANGE app_access access_groups_ad Text NULL');
$table->dropColumn('created_at');
$table->dropColumn('updated_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('magic_apps', function (Blueprint $table) {
$table->timestamps();
DB::statement('ALTER TABLE magic_apps CHANGE access_groups_ad app_access Text NULL');
//$table->renameColumn('access_groups_ad', 'app_access');
$table->dropColumn('role_driver');
$table->dropColumn('access_groups_email');
});
}
};
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Корректировка полей таблицы magic_apps
*/
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('magic_apps', function (Blueprint $table) {
$table->tinyInteger('isActive')->default(1)->change();
DB::statement('ALTER TABLE magic_apps CHANGE isActive is_active Tinyint');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('magic_apps', function (Blueprint $table) {
$table->tinyInteger('is_active')->default(NULL);
DB::statement('ALTER TABLE magic_apps CHANGE is_active isActive Tinyint');
});
}
};
@@ -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::table('app_roles', function(Blueprint $table){
$table->smallInteger('role_priority')->comment('Приоритет роли')->after('app_role');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('app_roles', function(Blueprint $table){
$table->dropColumn('role_priority');
});
}
};
@@ -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::table('app_roles', function(Blueprint $table){
$table->string('app_title')->nullable(false)->comment('Название роли на русском')->after('app_role');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('app_roles', function(Blueprint $table){
$table->dropColumn('app_title');
});
}
};
@@ -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::table('magic_apps', function(Blueprint $table) {
$table->string('app_title')->nullable(false)->comment('Название приложения на русском')->after('app_name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('magic_apps', function(Blueprint $table) {
$table->dropColumn('app_title');
});
}
};
@@ -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::table('activity_log', function(Blueprint $table){
$table->string('business_event', 50)->comment('кастомное событие')->after('event')->nullable(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('activity_log', function(Blueprint $table){
$table->dropColumn('business_event');
});
}
};
+6 -9
View File
@@ -2,24 +2,21 @@
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
use WithoutModelEvents;
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
// \App\Models\User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
// \App\Models\User::factory()->create([
// 'name' => 'Test User',
// 'email' => 'test@example.com',
// ]);
}
}