text: /*
  Navicat MySQL Data Transfer
  
  Source Server         : LOCAL
  Source Server Version : 50620
  Source Host           : localhost:3306
  Source Database       : ci_master_detail_trans
  
  Target Server Type    : MYSQL
  Target Server Version : 50620
  File Encoding         : 65001
  
  Date: 2016-03-23 17:55:32
  */
  
  SET FOREIGN_KEY_CHECKS=0;
  
  -- ----------------------------
  -- Table structure for address
  -- ----------------------------
  DROP TABLE IF EXISTS `address`;
  CREATE TABLE `address` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `customer_id` int(11) NOT NULL,
    `title_id` int(11) DEFAULT NULL,
    `address` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `customer_id` (`customer_id`),
    KEY `title_id` (`title_id`),
    CONSTRAINT `address_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `address_ibfk_2` FOREIGN KEY (`title_id`) REFERENCES `address_title` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- ----------------------------
  -- Records of address
  -- ----------------------------
  
  -- ----------------------------
  -- Table structure for address_title
  -- ----------------------------
  DROP TABLE IF EXISTS `address_title`;
  CREATE TABLE `address_title` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  
  -- ----------------------------
  -- Records of address_title
  -- ----------------------------
  INSERT INTO `address_title` VALUES ('1', 'Home');
  INSERT INTO `address_title` VALUES ('2', 'Work');
  INSERT INTO `address_title` VALUES ('3', 'Other');
  
  -- ----------------------------
  -- Table structure for customer
  -- ----------------------------
  DROP TABLE IF EXISTS `customer`;
  CREATE TABLE `customer` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `avatar` blob NOT NULL,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- ----------------------------
  -- Records of customer
  -- ----------------------------
  