update
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('module_ip_address', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('module_host_id')->nullable()->default(null)->change();
|
||||
$table->unsignedBigInteger('module_network_id')->nullable()->default(null)->change();
|
||||
|
||||
$table->foreign('module_host_id')->references('id')->on('module_host')->onDelete('set null');
|
||||
$table->foreign('module_network_id')->references('id')->on('module_network')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('module_ip_address', function (Blueprint $table) {
|
||||
$table->dropForeign(['module_host_id']);
|
||||
$table->dropForeign(['module_network_id']);
|
||||
|
||||
$table->bigInteger('module_host_id')->default(0)->nullable(false)->change();
|
||||
$table->bigInteger('module_network_id')->default(0)->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user