update vm ticket
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
<?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('virtual_machines', function (Blueprint $table) {
|
||||
$table->string('username')->nullable()->after('ip');
|
||||
$table->string('password')->nullable()->after('username');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('virtual_machines', function (Blueprint $table) {
|
||||
$table->dropColumn(['username', 'password']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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('ticket', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('ticket', 'gallery')) {
|
||||
$table->json('gallery')->nullable()->after('data');
|
||||
}
|
||||
// customer_id was bigInteger (signed); must match customers.id (unsignedBigInteger)
|
||||
$table->unsignedBigInteger('customer_id')->change();
|
||||
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ticket', function (Blueprint $table) {
|
||||
$table->dropForeign(['customer_id']);
|
||||
$table->bigInteger('customer_id')->default(0)->change();
|
||||
$table->dropColumn('gallery');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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('ticket_reply', function (Blueprint $table) {
|
||||
$table->longText('message')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ticket_reply', function (Blueprint $table) {
|
||||
$table->text('message')->nullable()->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user