Dokumentace migrace DB
authorThomas Mudrunka <tomas@mudrunka.cz>
Sat, 15 Jun 2013 00:54:56 +0000 (02:54 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Sat, 15 Jun 2013 00:54:56 +0000 (02:54 +0200)
assistants/migrations.inc.php

index dd7b436d1ecec8afd2ee0f6586a38a2383370d96..93a720f8fef46d7c3f4fb7944de9a97219892946 100644 (file)
@@ -1,4 +1,8 @@
 <pre>
+<h1>-- Remove all uncountable items</h1>
+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;
 <h1>-- populate barcode table</h1><?php
 $data = $this->db->safe_query_fetch('SELECT model_id as id, model_barcode as bar FROM model;', false);
 //print_r($data);
This page took 0.306441 seconds and 4 git commands to generate.