Add datastore_id to OS model and related functionality; update validation and relationships

This commit is contained in:
baodev0
2026-07-21 11:10:45 +07:00
parent c3b5417b19
commit 2d43e95855
9 changed files with 69 additions and 15 deletions
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('os', function (Blueprint $table) {
$table->unsignedBigInteger('datastore_id')->nullable()->after('module_host_id');
$table->foreign('datastore_id')
->references('id')
->on('module_datastore')
->nullOnDelete();
});
}
public function down(): void
{
Schema::table('os', function (Blueprint $table) {
$table->dropForeign(['datastore_id']);
$table->dropColumn('datastore_id');
});
}
};
+1 -2
View File
@@ -23,7 +23,6 @@ class DatabaseSeeder extends Seeder
$user->assignRole('Full Administrator');
$this->call(TemplateSeeder::class);
$this->call(Setting::class);
// $this->call(ControlPanelSeeder::class);
// $this->call(VPSProductSeeder::class);
}
}