PHP Classes

File: doc/create_tables-only.sql

Recommend this page to a friend!
  Classes of Pierre FAUQUE   Genealogy Classes   doc/create_tables-only.sql   Download  
File: doc/create_tables-only.sql
Role: Auxiliary data
Content type: text/plain
Description: Create structure
Class: Genealogy Classes
Manage genealogy trees for a family
Author: By
Last change: Change listing priority
Date: 12 years ago
Size: 7,762 bytes
 

Contents

Class file image Download
-- Eventually : -- CREATE DATABASE demo; -- GRANT ALL PRIVILEGES on demo.* to user-x IDENTIFIED BY 'password'; -- USE demo; -- -- Table structure for table `gen_Addresses` -- DROP TABLE IF EXISTS `gen_Addresses`; CREATE TABLE `gen_Addresses` ( `idaddr` int(11) NOT NULL auto_increment COMMENT 'ID of an address', `addr` varchar(60) NOT NULL COMMENT 'Address libel', `acode` varchar(5) NOT NULL COMMENT 'Address zipcode', `aplac` varchar(30) NOT NULL COMMENT 'Address place (city)', `actry` char(2) NOT NULL COMMENT 'Address country', `aphon` varchar(15) NOT NULL COMMENT 'Phone at this address', `myobs` varchar(200) NOT NULL COMMENT 'My personnal comments', PRIMARY KEY (`idaddr`) ) ENGINE=MyISAM COMMENT='Table of addresses'; -- -- Table structure for table `gen_Marry` -- DROP TABLE IF EXISTS `gen_Marry`; CREATE TABLE `gen_Marry` ( `idfam` int(11) NOT NULL auto_increment COMMENT 'ID of the family', `idh` int(11) NOT NULL default '0' COMMENT 'ID of the husband', `idw` int(11) NOT NULL default '0' COMMENT 'ID of the wife', `idunion` int(11) NOT NULL default '0' COMMENT 'ID of the union', `udate` varchar(10) NOT NULL COMMENT 'Date of the union', `uplac` varchar(30) NOT NULL COMMENT 'Place of the union (city)', `ucode` char(5) NOT NULL COMMENT 'Code of the city of the union', `uctry` char(2) NOT NULL COMMENT 'Country of the union', `usour` int(11) NOT NULL default '0' COMMENT 'Source of the union (document, act)', `idend` tinyint(4) NOT NULL default '0' COMMENT 'ID of the eventual end of union', `edate` varchar(10) NOT NULL COMMENT 'Date of this eventual end of union', `eplac` varchar(30) NOT NULL COMMENT 'Place of this eventual end of union (city)', `ecode` varchar(5) NOT NULL COMMENT 'Code of the city of this eventual end of union', `ectry` char(2) NOT NULL COMMENT 'Country of this eventual end of union', `uorder` int(11) NOT NULL default '0' COMMENT 'Order of this union (if several)', `nchi` tinyint(4) default NULL COMMENT 'Number of children (if known)', `myobs` varchar(200) NOT NULL COMMENT 'My personnal comments', PRIMARY KEY (`idfam`,`idh`,`idw`) ) ENGINE=MyISAM COMMENT='Table of unions'; -- -- Table structure for table `gen_Notes` -- DROP TABLE IF EXISTS `gen_Notes`; CREATE TABLE `gen_Notes` ( `idnote` int(11) NOT NULL auto_increment COMMENT 'ID of the note', `idpers` int(11) NOT NULL COMMENT 'ID of the person', `nallow` tinyint(4) NOT NULL default '1' COMMENT 'Note allowed for display (0:no, 1:yes)', `note` varchar(250) NOT NULL COMMENT 'Note libel', `norder` int(11) NOT NULL COMMENT 'Order of this note for this person', PRIMARY KEY (`idnote`), KEY `idpers` (`idpers`) ) ENGINE=MyISAM COMMENT='Table of event''s people'; -- -- Table structure for table `gen_People` -- DROP TABLE IF EXISTS `gen_People`; CREATE TABLE `gen_People` ( `idpers` int(11) NOT NULL auto_increment COMMENT 'ID of the person', `sex` enum('U','M','F') NOT NULL default 'U' COMMENT 'Sex of the person', `alias` varchar(30) NOT NULL COMMENT 'Alias of the person', `lname` varchar(30) NOT NULL COMMENT 'Last name', `fname` varchar(50) NOT NULL COMMENT 'First name', `bdate` varchar(10) NOT NULL COMMENT 'Date of birth', `bplac` varchar(30) NOT NULL COMMENT 'Place of birth', `bcode` char(5) NOT NULL COMMENT 'Code of the place of birth', `bctry` char(2) NOT NULL COMMENT 'Country of birth', `bsour` int(11) NOT NULL default '0' COMMENT 'Source of birth (document, act)', `ddate` varchar(10) NOT NULL COMMENT 'Date of death', `dplac` varchar(30) NOT NULL COMMENT 'Place of death', `dcode` char(5) NOT NULL COMMENT 'Code of the place of death', `dctry` char(2) NOT NULL COMMENT 'Country of death', `dsour` int(11) NOT NULL default '0' COMMENT 'Source of death (document, act)', `iplac` varchar(30) NOT NULL COMMENT 'Place of inhumation', `icode` char(5) NOT NULL COMMENT 'Code of place of inhumation', `ictry` char(2) NOT NULL COMMENT 'Country of inhumation', `idf` int(11) default '0' COMMENT 'ID of the Father', `idm` int(11) default '0' COMMENT 'ID of the Mother', `disp` int(11) NOT NULL default '1' COMMENT 'Display authorizations', `mail` varchar(50) NOT NULL COMMENT 'Mail of the person', `mphon` varchar(15) NOT NULL COMMENT 'Phone (mobile) of the person', `pic` varchar(25) NOT NULL COMMENT 'Picture filename', `pdate` varchar(10) NOT NULL COMMENT 'Year of the picture', `idaddr` int(11) NOT NULL default '0' COMMENT 'ID of his postal address', `porder` int(11) NOT NULL default '10' COMMENT 'Person order (in his family)', PRIMARY KEY (`idpers`) ) ENGINE=MyISAM COMMENT='Table of people'; -- -- Table structure for table `gen_Sources` -- DROP TABLE IF EXISTS `gen_Sources`; CREATE TABLE `gen_Sources` ( `idsrc` int(11) NOT NULL auto_increment COMMENT 'ID of the source', `sallow` smallint(6) NOT NULL default '1' COMMENT 'Source allowed for display (0:no, 1:yes)', `file` varchar(40) NOT NULL COMMENT 'filename of the source (scanned document)', `source` varchar(200) NOT NULL COMMENT 'Reference of this document', PRIMARY KEY (`idsrc`) ) ENGINE=MyISAM COMMENT='Table of sources'; -- -- Table structure for table `gen_Unions` -- DROP TABLE IF EXISTS `gen_Unions`; CREATE TABLE `gen_Unions` ( `idunion` tinyint(4) NOT NULL auto_increment COMMENT 'ID of the type of union or end of union', `union` varchar(30) NOT NULL COMMENT 'Union or end of union libel', PRIMARY KEY (`idunion`) ) ENGINE=MyISAM COMMENT='Table of types of unions'; -- -- Table structure for table `gen_Visitors` -- DROP TABLE IF EXISTS `gen_Visitors`; CREATE TABLE `gen_Visitors` ( `horodate` datetime NOT NULL COMMENT 'Datetime of the visit', `page` varchar(20) NOT NULL COMMENT 'Viewed page', `ip` varchar(15) NOT NULL COMMENT 'From this IP', PRIMARY KEY (`horodate`) ) ENGINE=MyISAM COMMENT='Table of visitors (some pages: PDF and GED)'; -- -- Table structure for table `geo_Cities` -- DROP TABLE IF EXISTS `geo_Cities`; CREATE TABLE `geo_Cities` ( `insee` varchar(5) NOT NULL COMMENT 'ID of the city (INSEE number)', `city` varchar(40) NOT NULL COMMENT 'Name of the city', `code` varchar(5) NOT NULL COMMENT 'Zipcode of the city', `mcity` tinyint(4) NOT NULL COMMENT 'Main city of the department (0:no, 1:yes)', `lat` decimal(11,6) NOT NULL COMMENT 'Latitude', `lon` decimal(11,6) NOT NULL COMMENT 'Longitude', `iddep` char(3) NOT NULL COMMENT 'ID of the department', PRIMARY KEY (`insee`) ) ENGINE=MyISAM COMMENT='Table of French cities'; -- -- Table structure for table `geo_Countries` -- DROP TABLE IF EXISTS `geo_Countries`; CREATE TABLE `geo_Countries` ( `tld` varchar(3) NOT NULL COMMENT 'ID of the country (Top Level Domain)', `country` varchar(45) NOT NULL COMMENT 'Name of the country', PRIMARY KEY (`tld`) ) ENGINE=MyISAM COMMENT='Table of countries'; -- -- Table structure for table `geo_Departments` -- DROP TABLE IF EXISTS `geo_Departments`; CREATE TABLE `geo_Departments` ( `iddep` varchar(3) NOT NULL COMMENT 'ID of the department', `idreg` tinyint(4) NOT NULL COMMENT 'ID of the region', `department` varchar(35) NOT NULL COMMENT 'Name of the department', PRIMARY KEY (`iddep`) ) ENGINE=MyISAM COMMENT='Table of French departments'; -- -- Table structure for table `geo_Regions` -- DROP TABLE IF EXISTS `geo_Regions`; CREATE TABLE `geo_Regions` ( `idreg` int(11) NOT NULL auto_increment COMMENT 'ID of the region', `region` varchar(30) NOT NULL COMMENT 'Name of the region', PRIMARY KEY (`idreg`) ) ENGINE=MyISAM COMMENT='Table of regions'; -- ---------- -- End -- ----------