some progress

This commit is contained in:
Doar Mihai
2026-01-17 16:42:43 +02:00
parent 030a105992
commit 3665a1d5a3
57 changed files with 5804 additions and 3 deletions
@@ -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->text('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable()->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
@@ -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('uptime_checks', function (Blueprint $table) {
$table->boolean('is_online')->nullable()->after('response_time_ms');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('uptime_checks', function (Blueprint $table) {
$table->dropColumn('is_online');
});
}
};
@@ -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('uptime_checks', function (Blueprint $table) {
$table->string('check_type', 10)->default('http')->after('site_id')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('uptime_checks', function (Blueprint $table) {
$table->dropColumn('check_type');
});
}
};
@@ -0,0 +1,40 @@
<?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('tcp_ports', function (Blueprint $table) {
$table->id();
$table->foreignId('site_id')->constrained()->onDelete('cascade');
$table->integer('port');
$table->string('name')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamp('last_checked_at')->nullable();
$table->boolean('is_open')->nullable();
$table->integer('response_time_ms')->nullable();
$table->timestamps();
// Indexes
$table->index('site_id');
$table->index('is_active');
$table->index(['site_id', 'port']);
$table->index('last_checked_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tcp_ports');
}
};
@@ -0,0 +1,42 @@
<?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('health_checks', function (Blueprint $table) {
$table->id();
$table->foreignId('site_id')->constrained()->onDelete('cascade');
$table->string('endpoint');
$table->json('expected_json_keys')->nullable();
$table->timestamp('last_checked_at')->nullable();
$table->boolean('is_healthy')->nullable();
$table->json('response_data')->nullable();
$table->integer('response_time_ms')->nullable();
$table->integer('status_code')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamps();
// Indexes
$table->index('site_id');
$table->index('is_active');
$table->index('is_healthy');
$table->index('last_checked_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('health_checks');
}
};
@@ -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('health_checks', function (Blueprint $table) {
$table->integer('performance_threshold')->nullable()->after('response_time_ms');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('health_checks', function (Blueprint $table) {
$table->dropColumn('performance_threshold');
});
}
};
@@ -0,0 +1,42 @@
<?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('dns_records', function (Blueprint $table) {
$table->id();
$table->foreignId('site_id')->constrained()->onDelete('cascade');
$table->string('domain');
$table->string('record_type'); // A, AAAA, MX, CNAME, TXT, NS, SOA
$table->text('expected_value')->nullable();
$table->timestamp('last_checked_at')->nullable();
$table->boolean('is_valid')->nullable();
$table->json('actual_value')->nullable();
$table->text('error_message')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamps();
// Indexes
$table->index('site_id');
$table->index('is_active');
$table->index('is_valid');
$table->index('last_checked_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('dns_records');
}
};