update
This commit is contained in:
@@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -13,13 +12,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('module_datastore',function (Blueprint $table) {
|
||||
Schema::create('module_datastore', function (Blueprint $table) {
|
||||
$table->id()->autoIncrement();
|
||||
$table->string('name',255)->nullable();
|
||||
$table->string('datastore',255)->nullable();
|
||||
$table->string('type',100)->nullable();
|
||||
$table->string('name', 255)->nullable();
|
||||
$table->string('datastore', 255)->nullable();
|
||||
$table->string('type', 100)->nullable();
|
||||
$table->integer('space')->nullable();
|
||||
$table->bigInteger('module_host_id')->default(0)->index();
|
||||
$table->foreignId('module_host_id')->index()->constrained('module_hosts')->cascadeOnDelete();
|
||||
$table->tinyInteger('status')->default(1);
|
||||
$table->timestamps();
|
||||
});
|
||||
@@ -32,6 +31,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('module_datastores');
|
||||
Schema::dropIfExists('module_datastore');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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('module_datastore', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('module_host_id')->default(0)->change();
|
||||
});
|
||||
|
||||
Schema::table('module_datastore', function (Blueprint $table) {
|
||||
$table->foreign('module_host_id')
|
||||
->references('id')
|
||||
->on('module_host')
|
||||
->cascadeOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('module_datastore', function (Blueprint $table) {
|
||||
$table->dropForeign(['module_host_id']);
|
||||
});
|
||||
|
||||
Schema::table('module_datastore', function (Blueprint $table) {
|
||||
$table->bigInteger('module_host_id')->default(0)->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user