Rework address roles, making Address::role optional, rework determining uplink/downlinks/parent/children

This commit is contained in:
2024-05-09 21:22:30 +10:00
parent 2765a27db8
commit 23159d19d5
23 changed files with 667 additions and 421 deletions

View File

@@ -0,0 +1,24 @@
<?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
{
DB::update('ALTER TABLE addresses ALTER COLUMN role DROP NOT NULL');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@@ -120,7 +120,7 @@ class TestNodeHierarchy extends Seeder
'node_id'=>$nid,
'point_id'=>0,
'system_id'=>$so->id,
'role'=>Address::NODE_ACTIVE,
'role'=>Address::NODE_NN,
'created_at'=>Carbon::now(),
'updated_at'=>Carbon::now(),
]);
@@ -167,7 +167,7 @@ class TestNodeHierarchy extends Seeder
'node_id'=>$nid,
'point_id'=>0,
'system_id'=>$so->id,
'role'=>Address::NODE_ACTIVE,
'role'=>Address::NODE_NN,
'created_at'=>Carbon::now(),
'updated_at'=>Carbon::now(),
]);
@@ -214,7 +214,7 @@ class TestNodeHierarchy extends Seeder
'node_id'=>$nid,
'point_id'=>0,
'system_id'=>$so->id,
'role'=>Address::NODE_ACTIVE,
'role'=>Address::NODE_NN,
'created_at'=>Carbon::now(),
'updated_at'=>Carbon::now(),
]);
@@ -251,7 +251,7 @@ class TestNodeHierarchy extends Seeder
'point_id'=>0,
'system_id'=>$so->id,
'hub_id'=>$hub->id,
'role'=>Address::NODE_ACTIVE,
'role'=>Address::NODE_NN,
'created_at'=>Carbon::now(),
'updated_at'=>Carbon::now(),
]);