Added laravel/passport, assign ftn addresses to nodes

This commit is contained in:
Deon George
2021-06-20 23:03:20 +10:00
parent 84df9ce811
commit 7cab4e288b
24 changed files with 1163 additions and 176 deletions

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAddresses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('addresses', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->boolean('active');
$table->integer('zone_id');
$table->foreign('zone_id')->references('id')->on('zones');
$table->integer('region_id')->nullable();
$table->integer('host_id')->nullable();
$table->integer('node_id');
$table->integer('point_id');
$table->integer('status')->nullable(); // @note Used to record Down/Private/Pending, etc
$table->integer('role')->nullable();
$table->integer('system_id');
$table->foreign('system_id')->references('id')->on('systems');
$table->unique(['zone_id','region_id','host_id','node_id']);
$table->unique(['zone_id','host_id','node_id','point_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('addresses');
}
}