A free open source IT asset/license management system
Fixed migration to use subquery instead (sqlite safe)
snipe143a876b4a03
diff --git a/database/migrations/2026_08_03_146000_add_created_by_to_order_items.php b/database/migrations/2026_08_03_146000_add_created_by_to_order_items.phpindex ab9976d324..65b7643828 100644--- a/database/migrations/2026_08_03_146000_add_created_by_to_order_items.php+++ b/database/migrations/2026_08_03_146000_add_created_by_to_order_items.php@@ -27,12 +27,17 @@ return new class extends Migration// Backfill existing rows from the parent Order.created_by so// history-tab renders and reports don't show a null column for- // every pre-migration line.+ // every pre-migration line. Subquery form is portable across+ // MariaDB (prod) and SQLite (tests) — UPDATE...JOIN differs+ // between the two.DB::statement('UPDATE order_items- JOIN orders ON orders.id = order_items.order_id- SET order_items.created_by = orders.created_by- WHERE order_items.created_by IS NULL+ SET created_by = (+ SELECT orders.created_by+ FROM orders+ WHERE orders.id = order_items.order_id+ )+ WHERE created_by IS NULL');}