-- 
-- Structure for table `company`
-- 

DROP TABLE IF EXISTS `company`;
CREATE TABLE IF NOT EXISTS `company` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `owner_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `adress` text CHARACTER SET utf8 NOT NULL,
  `phone` int(11) NOT NULL,
  `city` varchar(100) CHARACTER SET utf8 NOT NULL,
  `state` varchar(100) CHARACTER SET utf8 NOT NULL,
  `zip` int(11) NOT NULL,
  `contacts` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`),
  KEY `owner_id` (`owner_id`),
  KEY `owner_id_2` (`owner_id`),
  CONSTRAINT `FK_company` FOREIGN KEY (`owner_id`) REFERENCES `owner` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

-- 
-- Data for table `company`
-- 

INSERT INTO `company` (`id`, `owner_id`, `name`, `adress`, `phone`, `city`, `state`, `zip`, `contacts`) VALUES
  ('1', '1', 'fahad', 'asldkfj', '99', 'bahawalpur', 'punjab', '897987', 'asdf');

-- 
-- Structure for table `owner`
-- 

DROP TABLE IF EXISTS `owner`;
CREATE TABLE IF NOT EXISTS `owner` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `firstname` varchar(100) CHARACTER SET utf8 NOT NULL,
  `lastname` varchar(100) CHARACTER SET utf8 NOT NULL,
  `dob` date NOT NULL,
  `position` varchar(100) CHARACTER SET utf8 NOT NULL,
  `phone` int(11) NOT NULL,
  `notes` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

-- 
-- Data for table `owner`
-- 

INSERT INTO `owner` (`id`, `name`, `firstname`, `lastname`, `dob`, `position`, `phone`, `notes`) VALUES
  ('1', 'fahad', 'fahad', 'akram', '0000-00-00', 'owner', '99', 'afasdfasdf'),
  ('2', 'rehmat', 'rehmat', 'ullah', '0000-00-00', 'ownerrehmat', '222222', 'asdfasdf'),
  ('3', 'fahad', 'fahad', 'akram', '0000-00-00', 'owner', '99', '');

-- 
-- Structure for table `user`
-- 

DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(225) DEFAULT NULL,
  `password` varchar(225) DEFAULT NULL,
  `email` varchar(256) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

-- 
-- Data for table `user`
-- 

INSERT INTO `user` (`id`, `username`, `password`, `email`) VALUES
  ('1', 'admin', '123', '');


