From a12d11db90025d222cc19ec7c4406b608a5b45ab Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Wed, 11 Apr 2012 13:55:09 +0200 Subject: [PATCH] Vylepseny migracni nastroje --- assistants/migrations.inc.php | 8 +++++--- locale/cs/messages.inc.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) 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', -- 2.30.2