Do tabulky item pridany sloupecky s datem nakupu
authorThomas Mudrunka <tomas@mudrunka.cz>
Wed, 11 Apr 2012 10:56:21 +0000 (12:56 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Wed, 11 Apr 2012 10:56:21 +0000 (12:56 +0200)
assistants/migrations.inc.php [new file with mode: 0644]
install.sql
locale/cs/messages.inc.php

diff --git a/assistants/migrations.inc.php b/assistants/migrations.inc.php
new file mode 100644 (file)
index 0000000..95d3b86
--- /dev/null
@@ -0,0 +1,6 @@
+<pre><h1>populate column item_date_bought</h1><?php
+$data = $this->db->safe_query_fetch('SELECT item_id,MIN(item_valid_from) AS item_valid_from 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");
+echo("COMMIT;\n");
index aff355848a8f3f25cad2a53edf946547a28e4069..6d991ec01a981c64809a485626a47fd85c4e57d4 100644 (file)
@@ -202,7 +202,7 @@ UNLOCK TABLES;
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
--- Dump completed on 2012-03-19 12:20:46
+-- Dump completed on 2012-04-11 12:55:35
 
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -228,6 +228,8 @@ CREATE TABLE `item` (
   `item_price_in` decimal(9,2) NOT NULL DEFAULT '0.00',
   `item_price_out` decimal(9,2) DEFAULT NULL,
   `item_customer` int(11) DEFAULT NULL,
+  `item_date_bought` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `item_date_sold` timestamp NULL DEFAULT '0000-00-00 00:00:00',
   `item_note` varchar(512) COLLATE utf8_czech_ci DEFAULT NULL,
   `item_author` int(11) NOT NULL,
   `item_valid_till` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
index a5f05eaae68fb3e376c210c38b017c8fe87a5b2d..1dbb7e75c5006a5a8504f47c54a3f4809b5b0c7d 100644 (file)
@@ -17,6 +17,8 @@ $LOCALE_MESSAGES = array(
                'item_price_in' => 'Nákupní cena',
                'item_price_out' => 'Prodejní cena',
                'item_customer' => 'Zákazník',
+               'item_date_bought' => 'Koupeno',
+               'item_date_sold' => 'Prodáno',
                'item_note' => 'Poznámka k položce (umístění,...)',
                'item_author' => 'Odpovědný',
                'item_author_backend' => 'Odpovědný',
This page took 0.15065 seconds and 4 git commands to generate.