clrghouz/database/migrations/2022_11_03_115325_nodelist.php

38 lines
833 B
PHP
Raw Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('domains', function (Blueprint $table) {
$table->string('nodelist_filename')->nullable();
$table->bigInteger('nodelist_filearea_id')->nullable();
$table->foreign('nodelist_filearea_id')->references('id')->on('fileareas');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('domains', function (Blueprint $table) {
$table->dropForeign(['nodelist_filearea_id']);
$table->dropColumn(['nodelist_filename','nodelist_filearea_id']);
});
}
};