Initial echomail import
This commit is contained in:
@@ -17,12 +17,13 @@ class CreateNodes extends Migration
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('zone_id')->index();
|
||||
$table->integer('region_id');
|
||||
$table->integer('region_id')->nullable();
|
||||
$table->integer('host_id')->index();
|
||||
$table->integer('hub_id')->nullable()->index();
|
||||
$table->integer('node_id')->index();
|
||||
$table->integer('point_id')->default(0);
|
||||
|
||||
$table->binary('active');
|
||||
$table->boolean('active');
|
||||
$table->string('status')->nullable();
|
||||
$table->string('system');
|
||||
$table->string('sysop');
|
||||
@@ -31,13 +32,12 @@ class CreateNodes extends Migration
|
||||
$table->string('phone')->nullable();
|
||||
$table->binary('zt',10)->nullable();
|
||||
|
||||
$table->unique(['zone_id','region_id','id']);
|
||||
$table->unique(['zone_id','host_id','node_id','point_id']);
|
||||
$table->unique(['zone_id','zt']);
|
||||
|
||||
// $table->index('zone_id');
|
||||
$table->foreign('zone_id')->references('id')->on('zones');
|
||||
|
||||
$table->unique(['zone_id','host_id','id']);
|
||||
// $table->unique(['zone_id','host_id','id']);
|
||||
// $table->index(['zone_id','host_id']);
|
||||
// $table->index(['zone_id','id']);
|
||||
// $table->foreign(['zone_id','host_id'])->references(['zone_id','id'])->on('nodes');
|
||||
|
56
database/migrations/2019_04_26_112227_create_echomail.php
Normal file
56
database/migrations/2019_04_26_112227_create_echomail.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateEchomail extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('echomails', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('pkt_from');
|
||||
$table->integer('pkt_to');
|
||||
$table->datetime('pkt_date');
|
||||
$table->string('pkt');
|
||||
$table->string('flags');
|
||||
$table->integer('cost');
|
||||
$table->string('from_user');
|
||||
$table->integer('from_ftn');
|
||||
$table->string('to_user');
|
||||
$table->string('subject');
|
||||
$table->datetime('date');
|
||||
$table->string('tz')->nullable();
|
||||
$table->string('area');
|
||||
$table->string('msgid')->nullable();
|
||||
$table->string('replyid')->nullable();
|
||||
$table->text('message');
|
||||
$table->string('origin');
|
||||
$table->text('original')->nullable();
|
||||
|
||||
$table->index('pkt_from');
|
||||
$table->index('pkt_to');
|
||||
$table->index('from_ftn');
|
||||
$table->foreign('pkt_from')->references('id')->on('nodes');
|
||||
$table->foreign('pkt_to')->references('id')->on('nodes');
|
||||
$table->foreign('from_ftn')->references('id')->on('nodes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('echomails');
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateEchomailTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('echomail_kludge', function (Blueprint $table) {
|
||||
$table->integer('echomail_id');
|
||||
$table->string('kludge_id')->nullable();
|
||||
$table->json('value');
|
||||
|
||||
$table->index('echomail_id');
|
||||
$table->foreign('echomail_id')->references('id')->on('echomails');
|
||||
});
|
||||
|
||||
Schema::create('echomail_seenby', function (Blueprint $table) {
|
||||
$table->integer('echomail_id');
|
||||
$table->integer('node_id');
|
||||
|
||||
$table->unique(['echomail_id','node_id']);
|
||||
|
||||
$table->index('echomail_id');
|
||||
$table->foreign('echomail_id')->references('id')->on('echomails');
|
||||
$table->index('node_id');
|
||||
$table->foreign('node_id')->references('id')->on('nodes');
|
||||
});
|
||||
|
||||
Schema::create('echomail_path', function (Blueprint $table) {
|
||||
$table->integer('echomail_id');
|
||||
$table->integer('node_id');
|
||||
$table->integer('sequence');
|
||||
|
||||
$table->unique(['echomail_id','sequence']);
|
||||
|
||||
$table->index('echomail_id');
|
||||
$table->foreign('echomail_id')->references('id')->on('echomails');
|
||||
$table->index('node_id');
|
||||
$table->foreign('node_id')->references('id')->on('nodes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('echomail_path');
|
||||
Schema::dropIfExists('echomail_seenby');
|
||||
Schema::dropIfExists('echomail_kludge');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user