-DROP TABLE IF EXISTS `item`;
-SET @saved_cs_client = @@character_set_client;
-SET character_set_client = utf8;
-CREATE TABLE `item` (
- `item_id` int(11) NOT NULL auto_increment,
- `model_id` int(11) NOT NULL,
- `vendor_id` int(11) NOT NULL,
- `item_serial` varchar(128) collate utf8_czech_ci NOT NULL,
- `item_quantity` int(11) default NULL,
- `room_id` int(11) NOT NULL default '1',
- `status_id` int(11) NOT NULL default '1',
- `item_price_in` decimal(9,2) NOT NULL default '0.00',
- `item_price_out` decimal(9,2) default NULL,
- `user_id` int(11) NOT NULL,
- `item_valid_from` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- `item_valid_till` timestamp NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (`item_id`,`item_valid_till`),
- UNIQUE KEY `item_serial` (`item_serial`),
- KEY `vendor_id` (`vendor_id`),
- KEY `model_id` (`model_id`),
- KEY `status_id` (`status_id`),
- KEY `room_id` (`room_id`),
- CONSTRAINT `item_ibfk_6` FOREIGN KEY (`vendor_id`) REFERENCES `vendor` (`vendor_id`),
- CONSTRAINT `item_ibfk_7` FOREIGN KEY (`model_id`) REFERENCES `model` (`model_id`),
- CONSTRAINT `item_ibfk_8` FOREIGN KEY (`status_id`) REFERENCES `status` (`status_id`),
- CONSTRAINT `item_ibfk_9` FOREIGN KEY (`room_id`) REFERENCES `room` (`room_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
-SET character_set_client = @saved_cs_client;
-
---
--- Dumping data for table `item`
---
-
-LOCK TABLES `item` WRITE;
-/*!40000 ALTER TABLE `item` DISABLE KEYS */;
-INSERT INTO `item` VALUES (9,3,2,'SATAN',0,1,1,'0.10','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(20,3,1,'editmeeeee',23,1,1,'0.00','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(22,1,1,'ahoj',42,1,1,'1.00','2.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(24,1,1,'',0,1,4,'0.00','0.00',0,'0000-00-00 00:00:00','2011-08-05 03:15:20'),(25,1,1,'sdaNEW8',1,1,1,'0.00','0.00',23,'2011-08-05 04:14:17','0000-00-00 00:00:00'),(25,1,1,'sdaNEW',1,1,1,'0.00','0.00',0,'2011-08-05 03:20:15','2011-08-05 03:20:15'),(25,1,1,'sdaNEW4',1,1,1,'0.00','0.00',0,'2011-08-05 03:59:20','2011-08-05 03:59:20'),(25,1,1,'sdaNEW5',1,1,1,'0.00','0.00',0,'2011-08-05 04:00:30','2011-08-05 04:00:30'),(25,1,1,'sdaNEW2',1,1,1,'0.00','0.00',0,'2011-08-05 04:05:11','2011-08-05 04:05:11'),(25,1,1,'sdaNEW6',1,1,1,'0.00','0.00',0,'2011-08-05 04:06:04','2011-08-05 04:06:04'),(25,1,1,'sdaNEW7',1,1,1,'0.00','0.00',0,'2011-08-05 04:14:16','2011-08-05 04:14:16');
-/*!40000 ALTER TABLE `item` ENABLE KEYS */;
-UNLOCK TABLES;
-
---
--- Table structure for table `model`
---
-
-DROP TABLE IF EXISTS `model`;
-SET @saved_cs_client = @@character_set_client;
-SET character_set_client = utf8;
-CREATE TABLE `model` (
- `model_id` int(11) NOT NULL auto_increment,
- `model_name` varchar(64) collate utf8_czech_ci NOT NULL,
- `producer_id` int(11) NOT NULL default '0',
- `category_id` int(11) NOT NULL default '0',
- `model_barcode` varchar(128) collate utf8_czech_ci NOT NULL,
- `model_price_out` decimal(9,2) default NULL,
- `model_descript` varchar(1024) collate utf8_czech_ci NOT NULL,
- PRIMARY KEY (`model_id`),
- UNIQUE KEY `model_barcode` (`model_barcode`),
- KEY `category_id` (`category_id`),
- KEY `producer_id` (`producer_id`),
- CONSTRAINT `model_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`),
- CONSTRAINT `model_ibfk_2` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
-SET character_set_client = @saved_cs_client;