feat(#18): added support for device mirroring

This commit is contained in:
Benjamin Nussbaum 2025-05-05 18:06:54 +02:00
parent 929e7fc4c0
commit 56210405ff
8 changed files with 186 additions and 37 deletions

View file

@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::table('devices', function (Blueprint $table) {

View file

@ -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('devices', function (Blueprint $table) {
$table->foreignId('mirror_device_id')->nullable()->constrained('devices')->nullOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('devices', function (Blueprint $table) {
$table->dropForeign(['mirror_device_id']);
$table->dropColumn('mirror_device_id');
});
}
};