mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Optimized product Grocycode handling on consume page (and others / general) (fixes #2571)
This commit is contained in:
26
migrations/0238.sql
Normal file
26
migrations/0238.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
CREATE VIEW product_barcodes_view
|
||||
AS
|
||||
SELECT
|
||||
pb.id,
|
||||
pb.product_id,
|
||||
pb.barcode,
|
||||
pb.qu_id,
|
||||
pb.amount,
|
||||
pb.shopping_location_id,
|
||||
pb.last_price,
|
||||
pb.note
|
||||
FROM product_barcodes pb
|
||||
|
||||
UNION ALL
|
||||
|
||||
-- Product Grocycodes
|
||||
SELECT
|
||||
p.id,
|
||||
p.id AS product_id,
|
||||
'grcy:p:' || CAST(p.id AS TEXT) AS barcode,
|
||||
p.qu_id_stock AS qu_id,
|
||||
NULL AS amount,
|
||||
NULL AS shopping_location_id,
|
||||
NULL AS last_price,
|
||||
NULL AS note
|
||||
FROM products p;
|
Reference in New Issue
Block a user