This commit is contained in:
pbao9
2026-01-27 15:36:58 +07:00
parent fb6b2159da
commit bfb5f9f4a5
15 changed files with 580 additions and 542 deletions
@@ -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();
});
}
};