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 62019e9a3..e5db962bd 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 @@ -20,13 +20,13 @@ return new class extends Migration plant_id BIGINT NOT NULL, item_id BIGINT NOT NULL, - serial_number TEXT NOT NULL UNIQUE, + serial_number TEXT NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), deleted_at TIMESTAMP, - UNIQUE (item_id, serial_number), + UNIQUE (plant_id, serial_number), FOREIGN KEY (item_id) REFERENCES items (id), FOREIGN KEY (line_id) REFERENCES lines (id), FOREIGN KEY (shift_id) REFERENCES shifts (id),