X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=assistants%2Fmigrations.inc.php;fp=assistants%2Fmigrations.inc.php;h=93a720f8fef46d7c3f4fb7944de9a97219892946;hb=55f254c03684e67ef7c26e2157e3312f7836f86c;hp=dd7b436d1ecec8afd2ee0f6586a38a2383370d96;hpb=fcd9da7371aa50b7536bfc7513c19f23f1cbbdc6;p=mirrors%2FSokoMan.git 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);