From 55f254c03684e67ef7c26e2157e3312f7836f86c Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Sat, 15 Jun 2013 02:54:56 +0200 Subject: [PATCH] Dokumentace migrace DB --- assistants/migrations.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assistants/migrations.inc.php b/assistants/migrations.inc.php index dd7b436..93a720f 100644 --- a/assistants/migrations.inc.php +++ b/assistants/migrations.inc.php @@ -1,4 +1,8 @@
+

-- Remove all uncountable items

+SELECT DISTINCT model_countable FROM model; +DELETE item FROM item LEFT JOIN barcode USING(barcode_id) LEFT JOIN model USING(model_id) WHERE model_countable=0; +UPDATE model SET model_countable=1;

-- populate barcode table

db->safe_query_fetch('SELECT model_id as id, model_barcode as bar FROM model;', false); //print_r($data); -- 2.30.2