From: Thomas Mudrunka Date: Wed, 11 Apr 2012 11:55:09 +0000 (+0200) Subject: Vylepseny migracni nastroje X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=a12d11db90025d222cc19ec7c4406b608a5b45ab;p=mirrors%2FSokoMan.git Vylepseny migracni nastroje --- diff --git a/assistants/migrations.inc.php b/assistants/migrations.inc.php index 95d3b86..acfe3bf 100644 --- a/assistants/migrations.inc.php +++ b/assistants/migrations.inc.php @@ -1,6 +1,8 @@ -

populate column item_date_bought

db->safe_query_fetch('SELECT item_id,MIN(item_valid_from) AS item_valid_from FROM item GROUP BY item_id;'); +
+

populate columns item_date_bought and item_date_sold

db->safe_query_fetch('SELECT item_id,MIN(item_valid_from) AS min,MAX(item_valid_from) AS max FROM item GROUP BY item_id;'); //print_r($data); echo("START TRANSACTION;\n"); -foreach($data as $line) echo("UPDATE item SET item_date_bought='".$line['item_valid_from']."' WHERE item_id=".$line['item_id'].";\n"); +foreach($data as $line) echo("UPDATE item SET item_date_bought='".$line['min']."',item_date_sold='".$line['max']."' WHERE item_id=".$line['item_id'].";\n"); echo("COMMIT;\n"); +?> diff --git a/locale/cs/messages.inc.php b/locale/cs/messages.inc.php index 1376b15..6858cda 100644 --- a/locale/cs/messages.inc.php +++ b/locale/cs/messages.inc.php @@ -89,6 +89,7 @@ $LOCALE_MESSAGES = array( 'store-single' => 'pridat model a naskladnit', 'category-tree' => 'strom kategorií', 'price-list' => 'ceník', + 'migrations' => 'migrace', 'update' => 'UPRAVIT', 'insert' => 'VLOŽIT',