2026.06.8
This commit is contained in:
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('replication_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('status')->nullable(); // success | partial_success | failed
|
||||
$table->string('schedule_id')->nullable(); // какое расписание запускалось (если известно)
|
||||
$table->unsignedInteger('tables_success')->default(0);
|
||||
$table->unsignedInteger('tables_failed')->default(0);
|
||||
$table->json('errors')->nullable(); // массив ошибок из вебхука
|
||||
$table->json('payload')->nullable(); // сырой payload вебхука
|
||||
$table->timestamp('received_at')->nullable(); // когда пришёл вебхук
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('status');
|
||||
$table->index('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('replication_logs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('replication_schedules', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('schedule_id')->unique(); // ID расписания в репликаторе (syncio)
|
||||
$table->string('name')->nullable(); // человекочитаемое имя (для кнопки)
|
||||
$table->boolean('is_active')->default(true); // участвует в фильтре вебхука и шорткатах
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
// Расписания, связанные с проектом
|
||||
DB::table('replication_schedules')->insert([
|
||||
[
|
||||
'schedule_id' => '4969c65e-6824-45c8-b221-8cfca5c29m12',
|
||||
'name' => 'Основная (m12)',
|
||||
'is_active' => true,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
[
|
||||
'schedule_id' => '4969c65e-6824-45c8-b221-8cfca5c29m06',
|
||||
'name' => 'Основная (m06)',
|
||||
'is_active' => true,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('replication_schedules');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user