Permalink
Browse files

Updated database file

  • Loading branch information...
1 parent f81f1ba commit 04e1fac5534f889d88607a868a6f64fb6bcd3e73 @iicmaster committed May 27, 2012
Showing with 75 additions and 48 deletions.
  1. +75 −48 database/champ.sql
View
@@ -1,9 +1,9 @@
-- --------------------------------------------------------
-- Host: 127.0.0.1
--- Server version: 5.1.57-community - MySQL Community Server (GPL)
--- Server OS: Win64
--- HeidiSQL version: 7.0.0.4140
--- Date/time: 2012-05-24 12:20:55
+-- Server version: 5.5.16 - MySQL Community Server (GPL)
+-- Server OS: Win32
+-- HeidiSQL version: 7.0.0.4053
+-- Date/time: 2012-05-28 04:29:35
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
@@ -332,18 +332,19 @@ CREATE TABLE IF NOT EXISTS `production_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`description` text COLLATE utf8_unicode_ci,
`date_create` date NOT NULL,
- `date_exp` date DEFAULT NULL,
+ `date_exp` date NOT NULL,
`date_work` date NOT NULL,
`date_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.production_log: ~1 rows (approximately)
+-- Dumping data for table champ.production_log: ~3 rows (approximately)
DELETE FROM `production_log`;
/*!40000 ALTER TABLE `production_log` DISABLE KEYS */;
INSERT INTO `production_log` (`id`, `description`, `date_create`, `date_exp`, `date_work`, `date_update`) VALUES
(2, '', '2012-05-21', '0000-00-00', '2012-05-21', '2012-05-21 09:21:01'),
- (8, '', '2012-05-24', NULL, '2012-05-24', '2012-05-24 12:20:13');
+ (3, '', '2012-05-26', '0000-00-00', '2012-05-26', '2012-05-26 03:16:04'),
+ (4, '', '2012-05-26', '0000-00-00', '2012-05-26', '2012-05-26 14:08:08');
/*!40000 ALTER TABLE `production_log` ENABLE KEYS */;
@@ -358,42 +359,58 @@ CREATE TABLE IF NOT EXISTS `production_member` (
CONSTRAINT `FK_queue_member_queue` FOREIGN KEY (`id_log`) REFERENCES `production_log` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.production_member: ~16 rows (approximately)
+-- Dumping data for table champ.production_member: ~48 rows (approximately)
DELETE FROM `production_member`;
/*!40000 ALTER TABLE `production_member` DISABLE KEYS */;
INSERT INTO `production_member` (`id_log`, `id_member`) VALUES
(2, 1),
- (8, 1),
+ (3, 1),
+ (4, 1),
(2, 3),
- (8, 3),
+ (3, 3),
+ (4, 3),
(2, 5),
- (8, 5),
+ (3, 5),
+ (4, 5),
(2, 6),
- (8, 6),
+ (3, 6),
+ (4, 6),
(2, 7),
- (8, 7),
+ (3, 7),
+ (4, 7),
(2, 8),
- (8, 8),
+ (3, 8),
+ (4, 8),
(2, 9),
- (8, 9),
+ (3, 9),
+ (4, 9),
(2, 10),
- (8, 10),
+ (3, 10),
+ (4, 10),
(2, 11),
- (8, 11),
+ (3, 11),
+ (4, 11),
(2, 12),
- (8, 12),
+ (3, 12),
+ (4, 12),
(2, 13),
- (8, 13),
+ (3, 13),
+ (4, 13),
(2, 14),
- (8, 14),
+ (3, 14),
+ (4, 14),
(2, 15),
- (8, 15),
+ (3, 15),
+ (4, 15),
(2, 16),
- (8, 16),
+ (3, 16),
+ (4, 16),
(2, 17),
- (8, 17),
+ (3, 17),
+ (4, 17),
(2, 18),
- (8, 18);
+ (3, 18),
+ (4, 18);
/*!40000 ALTER TABLE `production_member` ENABLE KEYS */;
@@ -402,7 +419,7 @@ DROP TABLE IF EXISTS `production_product`;
CREATE TABLE IF NOT EXISTS `production_product` (
`id_log` int(10) unsigned NOT NULL,
`id_product` int(10) unsigned NOT NULL,
- `id_order` int(10) unsigned DEFAULT NULL,
+ `id_order` int(10) unsigned NOT NULL,
`type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = สต็อกปกติ, 1 = สั่งผลิตจากลูกค้า',
`quantity` int(10) unsigned NOT NULL,
KEY `FK_production_product_production_log` (`id_log`),
@@ -411,7 +428,7 @@ CREATE TABLE IF NOT EXISTS `production_product` (
CONSTRAINT `FK_production_product_production_log` FOREIGN KEY (`id_log`) REFERENCES `production_log` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.production_product: ~6 rows (approximately)
+-- Dumping data for table champ.production_product: ~18 rows (approximately)
DELETE FROM `production_product`;
/*!40000 ALTER TABLE `production_product` DISABLE KEYS */;
INSERT INTO `production_product` (`id_log`, `id_product`, `id_order`, `type`, `quantity`) VALUES
@@ -421,12 +438,18 @@ INSERT INTO `production_product` (`id_log`, `id_product`, `id_order`, `type`, `q
(2, 1, 0, 1, 200),
(2, 2, 0, 1, 100),
(2, 3, 0, 1, 50),
- (8, 1, NULL, 0, 400),
- (8, 2, NULL, 0, 200),
- (8, 3, NULL, 0, 100),
- (8, 1, NULL, 1, 200),
- (8, 2, NULL, 1, 100),
- (8, 3, NULL, 1, 50);
+ (3, 1, 0, 0, 400),
+ (3, 2, 0, 0, 200),
+ (3, 3, 0, 0, 100),
+ (3, 1, 0, 1, 200),
+ (3, 2, 0, 1, 100),
+ (3, 3, 0, 1, 50),
+ (4, 1, 0, 0, 400),
+ (4, 2, 0, 0, 200),
+ (4, 3, 0, 0, 100),
+ (4, 1, 0, 1, 200),
+ (4, 2, 0, 1, 100),
+ (4, 3, 0, 1, 50);
/*!40000 ALTER TABLE `production_product` ENABLE KEYS */;
@@ -469,17 +492,19 @@ CREATE TABLE IF NOT EXISTS `product_order` (
`tel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci,
`is_receive` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = ยังไม่ได้รับ, 1 = รับแล้ว',
+ `is_produced` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 = ยังไม่ได้ผลิต, 1 = ผลิตแล้ว',
`date_receive` date NOT NULL,
`date_create` date NOT NULL,
`date_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.product_order: ~1 rows (approximately)
+-- Dumping data for table champ.product_order: ~2 rows (approximately)
DELETE FROM `product_order`;
/*!40000 ALTER TABLE `product_order` DISABLE KEYS */;
-INSERT INTO `product_order` (`id`, `orderer`, `tel`, `description`, `is_receive`, `date_receive`, `date_create`, `date_update`) VALUES
- (7, 'ตรงกระแส กระแสสั้น', '123456789', '', 0, '2012-05-16', '2012-05-09', '2012-05-09 15:28:16');
+INSERT INTO `product_order` (`id`, `orderer`, `tel`, `description`, `is_receive`, `is_produced`, `date_receive`, `date_create`, `date_update`) VALUES
+ (7, 'ตรงกระแส กระแสสั้น', '123456789', '', 0, 0, '2012-05-16', '2012-05-09', '2012-05-09 15:28:16'),
+ (8, 'วรรณนิชา ', '0949776430', '', 0, 0, '2012-08-09', '2012-05-28', '2012-05-28 03:26:53');
/*!40000 ALTER TABLE `product_order` ENABLE KEYS */;
@@ -495,13 +520,15 @@ CREATE TABLE IF NOT EXISTS `product_order_item` (
CONSTRAINT `FK_product_order_item_product_order` FOREIGN KEY (`id_order`) REFERENCES `product_order` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.product_order_item: ~3 rows (approximately)
+-- Dumping data for table champ.product_order_item: ~5 rows (approximately)
DELETE FROM `product_order_item`;
/*!40000 ALTER TABLE `product_order_item` DISABLE KEYS */;
INSERT INTO `product_order_item` (`id_order`, `id_product`, `quantity`) VALUES
(7, 1, 200),
(7, 2, 100),
- (7, 3, 50);
+ (7, 3, 50),
+ (8, 1, 120),
+ (8, 2, 60);
/*!40000 ALTER TABLE `product_order_item` ENABLE KEYS */;
@@ -512,24 +539,24 @@ CREATE TABLE IF NOT EXISTS `product_stock` (
`id_production_log` int(10) unsigned NOT NULL DEFAULT '0',
`id_product` int(10) unsigned NOT NULL,
`type` tinyint(1) unsigned DEFAULT '0' COMMENT '0 = สต็อกปกติ, 1 = สั่งผลิตจากลูกค้า',
- `description` text COLLATE utf8_unicode_ci,
- `total` int(10) unsigned NOT NULL,
+ `description` text COLLATE utf8_unicode_ci NOT NULL,
+ `quantity` int(10) unsigned NOT NULL,
`date_create` datetime NOT NULL,
- `date_expire` datetime DEFAULT NULL,
+ `date_expire` datetime NOT NULL,
`date_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- `date_transaction_update` datetime DEFAULT NULL,
+ `date_transaction_update` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_product_stock_product` (`id_product`),
CONSTRAINT `FK_product_stock_product` FOREIGN KEY (`id_product`) REFERENCES `product` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--- Dumping data for table champ.product_stock: ~0 rows (approximately)
+-- Dumping data for table champ.product_stock: ~3 rows (approximately)
DELETE FROM `product_stock`;
/*!40000 ALTER TABLE `product_stock` DISABLE KEYS */;
-INSERT INTO `product_stock` (`id`, `id_production_log`, `id_product`, `type`, `description`, `total`, `date_create`, `date_expire`, `date_update`, `date_transaction_update`) VALUES
- (1, 8, 1, 0, NULL, 400, '2012-05-24 12:20:13', NULL, '2012-05-24 12:20:13', NULL),
- (2, 8, 2, 0, NULL, 200, '2012-05-24 12:20:13', NULL, '2012-05-24 12:20:13', NULL),
- (3, 8, 3, 0, NULL, 100, '2012-05-24 12:20:13', NULL, '2012-05-24 12:20:13', NULL);
+INSERT INTO `product_stock` (`id`, `id_production_log`, `id_product`, `type`, `description`, `quantity`, `date_create`, `date_expire`, `date_update`, `date_transaction_update`) VALUES
+ (1, 4, 1, 0, '', 400, '2012-05-26 14:08:08', '0000-00-00 00:00:00', '2012-05-26 14:08:08', '0000-00-00 00:00:00'),
+ (2, 4, 2, 0, '', 200, '2012-05-26 14:08:08', '0000-00-00 00:00:00', '2012-05-26 14:08:08', '0000-00-00 00:00:00'),
+ (3, 4, 3, 0, '', 100, '2012-05-26 14:08:08', '0000-00-00 00:00:00', '2012-05-26 14:08:08', '0000-00-00 00:00:00');
/*!40000 ALTER TABLE `product_stock` ENABLE KEYS */;

0 comments on commit 04e1fac

Please sign in to comment.