From: Thomas Mudrunka Date: Sat, 15 Jun 2013 00:54:56 +0000 (+0200) Subject: Dokumentace migrace DB X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=55f254c03684e67ef7c26e2157e3312f7836f86c;p=mirrors%2FSokoMan.git Dokumentace migrace DB --- 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);