From 8612cc08b13eee6e2bdc225810e57e2682ed99e3 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 24 Mar 2025 19:47:34 +0530 Subject: [PATCH] Masters and Transaction table column type update CITEXT --- .../2025_03_22_184847_create_line_stops_table.php | 4 ++-- .../migrations/2025_03_22_190920_create_lines_table.php | 4 ++-- ...025_03_23_163259_create_production_line_stops_table.php | 6 +++--- ...025_03_23_170155_create_production_quantities_table.php | 7 ++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/database/migrations/2025_03_22_184847_create_line_stops_table.php b/database/migrations/2025_03_22_184847_create_line_stops_table.php index 01e53483c..ccbc3cc8a 100644 --- a/database/migrations/2025_03_22_184847_create_line_stops_table.php +++ b/database/migrations/2025_03_22_184847_create_line_stops_table.php @@ -19,8 +19,8 @@ return new class extends Migration block_id BIGINT NOT NULL, plant_id BIGINT NOT NULL, - code TEXT NOT NULL, - reason TEXT NOT NULL, + code CITEXT NOT NULL, + reason CITEXT NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), diff --git a/database/migrations/2025_03_22_190920_create_lines_table.php b/database/migrations/2025_03_22_190920_create_lines_table.php index 9a058ee74..0b77ec608 100644 --- a/database/migrations/2025_03_22_190920_create_lines_table.php +++ b/database/migrations/2025_03_22_190920_create_lines_table.php @@ -18,8 +18,8 @@ return new class extends Migration block_id BIGINT NOT NULL, plant_id BIGINT NOT NULL, - name TEXT NOT NULL, - type TEXT NOT NULL, + name CITEXT NOT NULL, + type CITEXT NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), diff --git a/database/migrations/2025_03_23_163259_create_production_line_stops_table.php b/database/migrations/2025_03_23_163259_create_production_line_stops_table.php index efbba6e13..f94a05d84 100644 --- a/database/migrations/2025_03_23_163259_create_production_line_stops_table.php +++ b/database/migrations/2025_03_23_163259_create_production_line_stops_table.php @@ -19,8 +19,7 @@ return new class extends Migration block_id BIGINT NOT NULL, plant_id BIGINT NOT NULL, code_id BIGINT NOT NULL, - - reason TEXT NOT NULL, + reason_id BIGINT NOT NULL, from_datetime TIMESTAMP NOT NULL, to_datetime TIMESTAMP NOT NULL, @@ -35,7 +34,8 @@ return new class extends Migration FOREIGN KEY (shift_id) REFERENCES shifts (id), FOREIGN KEY (block_id) REFERENCES blocks (id), FOREIGN KEY (plant_id) REFERENCES plants (id), - FOREIGN KEY (code_id) REFERENCES line_stops (id) + FOREIGN KEY (code_id) REFERENCES line_stops (id), + FOREIGN KEY (reason_id) REFERENCES line_stops (id) ); SQL; diff --git a/database/migrations/2025_03_23_170155_create_production_quantities_table.php b/database/migrations/2025_03_23_170155_create_production_quantities_table.php index ff9a24b12..f24aaafe6 100644 --- a/database/migrations/2025_03_23_170155_create_production_quantities_table.php +++ b/database/migrations/2025_03_23_170155_create_production_quantities_table.php @@ -19,15 +19,16 @@ return new class extends Migration shift_id BIGINT NOT NULL, block_id BIGINT NOT NULL, plant_id BIGINT NOT NULL, + item_id BIGINT NOT NULL, - item_code TEXT NOT NULL, - serial_number TEXT NOT NULL, + serial_number CITEXT NOT NULL UNIQUE, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), deleted_at TIMESTAMP, - UNIQUE (item_code, serial_number), + UNIQUE (item_id, serial_number), + FOREIGN KEY (item_id) REFERENCES items (id), FOREIGN KEY (line_id) REFERENCES lines (id), FOREIGN KEY (shift_id) REFERENCES shifts (id), FOREIGN KEY (block_id) REFERENCES blocks (id),