Compare commits
2 Commits
8b00d29db3
...
de34052c3b
Author | SHA1 | Date | |
---|---|---|---|
de34052c3b | |||
cb63ec50d2 |
@ -25,7 +25,7 @@ class ZoneCheck extends Command
|
||||
$this->warn('Zone: '.$zo->zone_id);
|
||||
$this->info(sprintf('- Our address(es): %s',our_address($do)->pluck('ftn4d')->join(',')));
|
||||
|
||||
$this->table(['id','ftn','role','parent','children','downlinks','uplink','send from','region_id','system','notes'],$zo->addresses()->FTNorder()->active()->with(['system'])->get()->transform(function($item) {
|
||||
$this->table(['id','ftn','role','parent','children','downlinks','uplink','send from','region_id','system','notes'],$zo->addresses()->FTNorder()->active()->with(['system'])->dontCache()->get()->transform(function($item) {
|
||||
return [
|
||||
'id'=>$item->id,
|
||||
'ftn'=>$item->ftn4d,
|
||||
|
32
database/migrations/2024_05_23_204853_address_hub.php
Normal file
32
database/migrations/2024_05_23_204853_address_hub.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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('addresses', function (Blueprint $table) {
|
||||
$table->dropForeign(['hub_id']);
|
||||
$table->unique(['zone_id','region_id','host_id','id']);
|
||||
$table->foreign(['zone_id','region_id','host_id','hub_id'])->references(['zone_id','region_id','host_id','id'])->on('addresses');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('addresses', function (Blueprint $table) {
|
||||
$table->dropForeign(['zone_id','region_id','host_id','hub_id']);
|
||||
$table->dropUnique(['zone_id','region_id','host_id','id']);
|
||||
$table->foreign('hub_id')->references('id')->on('addresses');
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user