Added database recording

This commit is contained in:
2023-03-03 10:29:39 +11:00
parent a389264ec4
commit 32a75cb140
5 changed files with 101 additions and 41 deletions

View File

@@ -0,0 +1,39 @@
<?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('sites', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->ipAddress('ip_address');
});
Schema::create('site_versions', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string('version');
$table->json('response')->nullable();
$table->bigInteger('site_id');
$table->foreign('site_id')->references('id')->on('sites');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('site_versions');
Schema::dropIfExists('sites');
}
};