Added unique against plant an dgr number in migration file #1362

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-03 05:08:02 +00:00

View File

@@ -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
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql = <<<'SQL'
ALTER TABLE gr_masters
ADD CONSTRAINT gr_masters_plant_id_gr_number_key
UNIQUE (plant_id, gr_number)
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('gr_masters', function (Blueprint $table) {
// //
// });
}
};