Initial netmail import

This commit is contained in:
Deon George
2019-05-06 22:29:29 +10:00
parent 9ba790e72c
commit 188fd1a2cf
9 changed files with 344 additions and 71 deletions

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNetmailTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kludge_netmail', function (Blueprint $table) {
$table->integer('netmail_id');
$table->string('kludge_id')->nullable();
$table->json('value');
$table->index('netmail_id');
$table->foreign('netmail_id')->references('id')->on('netmails');
});
Schema::create('netmail_path', function (Blueprint $table) {
$table->integer('netmail_id');
$table->integer('node_id');
$table->integer('sequence');
$table->json('value');
$table->unique(['netmail_id','sequence']);
$table->index('netmail_id');
$table->foreign('netmail_id')->references('id')->on('netmails');
$table->index('node_id');
$table->foreign('node_id')->references('id')->on('nodes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('netmail_path');
Schema::dropIfExists('kludge_netmail');
}
}