added migration, model, resource , grid table

This commit is contained in:
dhanabalan
2025-04-08 17:26:00 +05:30
parent 5fd16612fc
commit 3381cfca7c
10 changed files with 540 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?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'
CREATE TABLE invoice_validations (
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
sticker_master_id BIGINT NOT NULL,
plant_id BIGINT NOT NULL,
invoice_number TEXT NOT NULL,
serial_number TEXT UNIQUE,
motor_scanned_status TEXT DEFAULT NULL,
pump_scanned_status TEXT DEFAULT NULL,
capacitor_scanned_status TEXT DEFAULT NULL,
scanned_status_set TEXT DEFAULT NULL,
scanned_status TEXT DEFAULT NULL,
panel_box_supplier TEXT DEFAULT NULL,
panel_box_serial_number TEXT DEFAULT NULL,
load_rate INT NOT NULL DEFAULT (0),
upload_status TEXT NOT NULL DEFAULT 'N',
batch_number TEXT DEFAULT NULL,
quantity INT DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP,
FOREIGN KEY (sticker_master_id) REFERENCES sticker_masters (id),
FOREIGN KEY (plant_id) REFERENCES plants (id)
);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('invoice_validations');
}
};