clrghouz/database/migrations/2021_08_10_130352_echomail.php
2021-08-11 23:45:49 +10:00

98 lines
2.5 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Echomail extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('echoareas', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->softDeletes();
$table->string('name');
$table->string('description');
$table->boolean('active');
$table->boolean('public');
$table->string('notes')->nullable();
$table->integer('domain_id');
$table->foreign('domain_id')->references('id')->on('domains');
});
Schema::create('fileareas', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->softDeletes();
$table->string('name');
$table->string('description');
$table->boolean('active');
$table->boolean('public');
$table->string('notes')->nullable();
$table->integer('domain_id');
$table->foreign('domain_id')->references('id')->on('domains');
});
Schema::create('address_echoarea', function (Blueprint $table) {
$table->integer('echoarea_id');
$table->foreign('echoarea_id')->references('id')->on('echoareas');
$table->integer('address_id');
$table->foreign('address_id')->references('id')->on('addresses');
$table->dateTime('subscribed');
});
Schema::create('address_filearea', function (Blueprint $table) {
$table->integer('filearea_id');
$table->foreign('filearea_id')->references('id')->on('fileareas');
$table->integer('address_id');
$table->foreign('address_id')->references('id')->on('addresses');
$table->dateTime('subscribed');
});
Schema::create('address_echomail', function (Blueprint $table) {
$table->integer('echomail_id');
$table->string('packet');
$table->integer('address_id');
$table->foreign('address_id')->references('id')->on('addresses');
});
Schema::create('address_file', function (Blueprint $table) {
$table->integer('filearea_id');
$table->boolean('sent');
$table->integer('address_id');
$table->foreign('address_id')->references('id')->on('addresses');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('address_file');
Schema::dropIfExists('address_echomail');
Schema::dropIfExists('address_filearea');
Schema::dropIfExists('fileareas');
Schema::dropIfExists('address_echoarea');
Schema::dropIfExists('echoareas');
}
}