DROP TABLE IF EXISTS `jobs`;
CREATE TABLE `jobs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `number` int(11) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
  `details` varchar(2000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `customer_id` int(11) unsigned DEFAULT NULL,
  `closed` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `insert_date` datetime NOT NULL,
  `change_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `delete_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1000;

DROP TABLE IF EXISTS `rfq_items`;
CREATE TABLE `rfq_items` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `rfq_id` int(10) unsigned NOT NULL,
  `line_number` smallint(5) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `quantity` int(10) unsigned NOT NULL DEFAULT '0',
  `vendor_quote` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `paper_or_substrate` varchar(800) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `cover` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `text` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `inks_or_coatings` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `binding_instructions` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `finishing` varchar(800) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `proofing` varchar(800) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `insert_date` datetime NOT NULL,
  `change_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

-- ----------------------------
-- Table structure for `rfqs`
-- ----------------------------
DROP TABLE IF EXISTS `rfqs`;
CREATE TABLE `rfqs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `job_id` int(11) unsigned NOT NULL,
  `vendor_id` int(11) unsigned NOT NULL,
  `issue_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `fulfillment_instructions` varchar(2000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ship_list_arrival_date` date DEFAULT NULL,
  `ship_date` date DEFAULT NULL,
  `in_hands_date` date DEFAULT NULL,
  `notes` varchar(2000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;