Initial netmail import
This commit is contained in:
60
database/migrations/2019_04_26_112307_create_netmail.php
Normal file
60
database/migrations/2019_04_26_112307_create_netmail.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateNetmail extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('netmails', 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->integer('to_ftn');
|
||||
$table->string('subject');
|
||||
$table->datetime('date');
|
||||
$table->string('tz')->nullable();
|
||||
$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->index('to_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');
|
||||
$table->foreign('to_ftn')->references('id')->on('nodes');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('netmails');
|
||||
}
|
||||
}
|
@@ -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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user