kosmeticky vylepseni migracnich skriptu
[mirrors/SokoMan.git] / assistants / migrations.inc.php
1 <pre>
2 <h1>-- populate columns item_date_bought and item_date_sold</h1><?php
3 $data = $this->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;');
4 //print_r($data);
5 echo("START TRANSACTION;\n");
6 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");
7 echo("COMMIT;\n");
8 ?>
9 </pre>
This page took 0.438632 seconds and 4 git commands to generate.