-- phpMyAdmin SQL Dump
-- version 3.3.7deb7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 15, 2012 at 09:15 PM
-- Server version: 5.1.63
-- PHP Version: 5.3.3-7+squeeze14

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `ffvaDB`
--

-- --------------------------------------------------------

--
-- Table structure for table `addresses`
--

CREATE TABLE IF NOT EXISTS `addresses` (
  `address_id` int(11) NOT NULL AUTO_INCREMENT,
  `street` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `number` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `zipcode` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` enum('Nederland','België') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Nederland',
  `extra_line` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `city` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`address_id`),
  UNIQUE KEY `street` (`street`,`number`,`zipcode`,`country`,`extra_line`,`city`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=92 ;

-- --------------------------------------------------------

--
-- Table structure for table `addresses2ppl`
--

CREATE TABLE IF NOT EXISTS `addresses2ppl` (
  `address_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`address_id`,`ppl_id`,`priority`,`established`,`disestablished`),
  KEY `address_id` (`address_id`),
  KEY `ppl_id` (`ppl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `config`
--

CREATE TABLE IF NOT EXISTS `config` (
  `key` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `value` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `datenodes`
--

CREATE TABLE IF NOT EXISTS `datenodes` (
  `datenode_id` int(11) NOT NULL AUTO_INCREMENT,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`datenode_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=235 ;

-- --------------------------------------------------------

--
-- Table structure for table `email`
--

CREATE TABLE IF NOT EXISTS `email` (
  `email_id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`email_id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=73 ;

-- --------------------------------------------------------

--
-- Table structure for table `email2ppl`
--

CREATE TABLE IF NOT EXISTS `email2ppl` (
  `email_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `familytree`
--

CREATE TABLE IF NOT EXISTS `familytree` (
  `parent_ppl_id` int(11) NOT NULL,
  `child_ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0',
  UNIQUE KEY `parent_ppl_id` (`parent_ppl_id`,`child_ppl_id`,`established`,`disestablished`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `firstnames`
--

CREATE TABLE IF NOT EXISTS `firstnames` (
  `firstname_id` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`firstname_id`),
  UNIQUE KEY `firstname` (`firstname`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=151 ;

-- --------------------------------------------------------

--
-- Table structure for table `firstnames2ppl`
--

CREATE TABLE IF NOT EXISTS `firstnames2ppl` (
  `firstname_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`firstname_id`,`ppl_id`,`priority`,`established`,`disestablished`),
  KEY `firstname_id` (`firstname_id`),
  KEY `ppl_id` (`ppl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `phonenumbers`
--

CREATE TABLE IF NOT EXISTS `phonenumbers` (
  `phonenumber_id` int(11) NOT NULL AUTO_INCREMENT,
  `phonenumber` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`phonenumber_id`),
  UNIQUE KEY `phonenumber` (`phonenumber`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=84 ;

-- --------------------------------------------------------

--
-- Table structure for table `phonenumbers2ppl`
--

CREATE TABLE IF NOT EXISTS `phonenumbers2ppl` (
  `phonenumber_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `ppl`
--

CREATE TABLE IF NOT EXISTS `ppl` (
  `ppl_id` int(11) NOT NULL AUTO_INCREMENT,
  `date_of_birth` int(11) NOT NULL DEFAULT '0',
  `date_of_death` int(11) NOT NULL DEFAULT '0',
  `username` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` char(55) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL COMMENT 'crypt $5$ with 8 salt ',
  PRIMARY KEY (`ppl_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=173 ;

-- --------------------------------------------------------

--
-- Table structure for table `relations`
--

CREATE TABLE IF NOT EXISTS `relations` (
  `relation_id` int(11) NOT NULL AUTO_INCREMENT,
  `established` int(11) NOT NULL DEFAULT '0',
  `type` enum('marriage','unmarried partnership','engaged') COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`relation_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;

-- --------------------------------------------------------

--
-- Table structure for table `relations2ppl`
--

CREATE TABLE IF NOT EXISTS `relations2ppl` (
  `relation_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  PRIMARY KEY (`relation_id`,`ppl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sex2ppl`
--

CREATE TABLE IF NOT EXISTS `sex2ppl` (
  `sex` enum('male','female') COLLATE utf8_unicode_ci NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`sex`,`ppl_id`,`established`,`disestablished`),
  KEY `ppl_id` (`ppl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `surnames`
--

CREATE TABLE IF NOT EXISTS `surnames` (
  `surname_id` int(11) NOT NULL AUTO_INCREMENT,
  `prefix` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `surname` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`surname_id`),
  UNIQUE KEY `prefix` (`prefix`,`surname`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=80 ;

-- --------------------------------------------------------

--
-- Table structure for table `surnames2ppl`
--

CREATE TABLE IF NOT EXISTS `surnames2ppl` (
  `surname_id` int(11) NOT NULL,
  `ppl_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL DEFAULT '500',
  `established` int(11) NOT NULL DEFAULT '0',
  `disestablished` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`surname_id`,`ppl_id`,`priority`,`established`,`disestablished`),
  KEY `surname_id` (`surname_id`),
  KEY `ppl_id` (`ppl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
