/*
SQLyog Ultimate v13.0.0 (64 bit)
MySQL - 10.1.25-MariaDB : Database - address_book
*********************************************************************
*/



CREATE DATABASE /*!32312 IF NOT EXISTS*/`address_book` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `address_book`;

/*Table structure for table `api` */


CREATE TABLE `api` (
  `api_id` varchar(12) NOT NULL COMMENT 'Token used for API call',
  `ip` varchar(200) DEFAULT NULL COMMENT 'IP address from which API call is authorised',
  `cosmetic_name` text COMMENT 'Cosmetic description of the API token',
  PRIMARY KEY (`api_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `api` */

/*Table structure for table `contacts` */


CREATE TABLE `contacts` (
  `contact_id` varchar(12) NOT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `middle_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `contact_number_home` varchar(20) DEFAULT NULL,
  `contact_number_mobile` varchar(20) DEFAULT NULL,
  `contact_email` varchar(100) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `address_line_1` varchar(100) DEFAULT NULL,
  `address_line_2` varchar(100) DEFAULT NULL,
  `address_town` varchar(100) DEFAULT NULL,
  `address_county` varchar(100) DEFAULT NULL,
  `address_post_code` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `contacts` */

/*Table structure for table `logs` */


CREATE TABLE `logs` (
  `log_id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime DEFAULT NULL,
  `action` longblob,
  `url` varchar(200) DEFAULT NULL,
  `user` varchar(200) DEFAULT NULL,
  `ip` varchar(200) DEFAULT NULL,
  `user_agent` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

