Added sticker mapping master migration file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 52s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 1m20s
Laravel Larastan / larastan (pull_request) Failing after 2m28s
Laravel Pint / pint (pull_request) Failing after 2m24s

This commit is contained in:
dhanabalan
2025-12-30 14:07:53 +05:30
parent 4daa72db8e
commit 2d81d41f34

View File

@@ -0,0 +1,91 @@
<?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 sticker_mapping_masters (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
plant_id BIGINT NOT NULL,
item_characteristic_id BIGINT DEFAULT NULL,
sticker_structure1_id BIGINT DEFAULT NULL,
sticker1_machine_id BIGINT DEFAULT NULL,
sticker1_print_ip TEXT DEFAULT NULL,
sticker_structure2_id BIGINT DEFAULT NULL,
sticker2_machine_id BIGINT DEFAULT NULL,
sticker2_print_ip TEXT DEFAULT NULL,
sticker_structure3_id BIGINT DEFAULT NULL,
sticker3_machine_id BIGINT DEFAULT NULL,
sticker3_print_ip TEXT DEFAULT NULL,
sticker_structure4_id BIGINT DEFAULT NULL,
sticker4_machine_id BIGINT DEFAULT NULL,
sticker4_print_ip TEXT DEFAULT NULL,
sticker_structure5_id BIGINT DEFAULT NULL,
sticker5_machine_id BIGINT DEFAULT NULL,
sticker5_print_ip TEXT DEFAULT NULL,
sticker_structure6_id BIGINT DEFAULT NULL,
sticker6_machine_id BIGINT DEFAULT NULL,
sticker6_print_ip TEXT DEFAULT NULL,
sticker_structure7_id BIGINT DEFAULT NULL,
sticker7_machine_id BIGINT DEFAULT NULL,
sticker7_print_ip TEXT DEFAULT NULL,
sticker_structure8_id BIGINT DEFAULT NULL,
sticker8_machine_id BIGINT DEFAULT NULL,
sticker8_print_ip TEXT DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
created_by TEXT DEFAULT NULL,
updated_by TEXT DEFAULT NULL,
deleted_at TIMESTAMP,
FOREIGN KEY (plant_id) REFERENCES plants(id),
FOREIGN KEY (item_characteristic_id) REFERENCES item_characteristics(id),
FOREIGN KEY (sticker_structure1_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure2_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure3_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure4_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure5_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure6_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure7_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker_structure8_id) REFERENCES sticker_structure_details(id),
FOREIGN KEY (sticker1_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker2_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker3_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker4_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker5_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker6_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker7_machine_id) REFERENCES machines(id),
FOREIGN KEY (sticker8_machine_id) REFERENCES machines(id)
);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sticker_mapping_masters');
}
};