up new code

up new code
This commit is contained in:
2025-08-19 05:59:14 +07:00
parent 95bb93afa6
commit 794c839a95
4 changed files with 112 additions and 157 deletions

View File

@@ -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
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('tickets', function (Blueprint $table) {
$table->unsignedInteger('submitdept_id')->nullable()->after('id');
$table->foreign('submitdept_id')->references('id')->on('department')->onDelete('cascade');
});
}
public function down()
{
Schema::table('tickets', function (Blueprint $table) {
$table->dropForeign(['submitdept_id']);
$table->dropColumn('submitdept_id');
});
}
};