# HeidiSQL Dump 
#
# --------------------------------------------------------
# Host:                         127.0.0.1
# Database:                     main
# Server version:               5.1.37
# Server OS:                    Win32
# Target compatibility:         ANSI SQL
# HeidiSQL version:             4.0
# Date/time:                    2009-11-03 11:10:45
# --------------------------------------------------------



#
# Database structure for database 'main'
#

CREATE DATABASE /*!32312 IF NOT EXISTS*/ "main" /*!40100 DEFAULT CHARACTER SET latin1 */;

USE "main";


#
# Table structure for table 'user'
#

CREATE TABLE /*!32312 IF NOT EXISTS*/ "user" (
  "id" mediumint(9) NOT NULL AUTO_INCREMENT,
  "username" varchar(60) NOT NULL DEFAULT '',
  "alter_username" varchar(60) NOT NULL DEFAULT '',
  "username_type" char(1) NOT NULL DEFAULT '' COMMENT 'E=email, M=mobile',
  "group" char(1) NOT NULL DEFAULT '' COMMENT 'i=individual g=group of indi c=comp ',
  "country_code" varchar(3) NOT NULL DEFAULT '' COMMENT 'country code',
  "password" varchar(60) NOT NULL DEFAULT '',
  "active" char(1) NOT NULL DEFAULT '',
  "language" varchar(4) NOT NULL DEFAULT '',
  "pwd_hint" varchar(30) NOT NULL DEFAULT '',
  "gender" char(1) NOT NULL DEFAULT '',
  "lastname" varchar(30) NOT NULL DEFAULT '',
  "firstname" varchar(30) NOT NULL DEFAULT '',
  "nickname" varchar(30) NOT NULL DEFAULT '',
  "comp_group_nam" varchar(60) NOT NULL DEFAULT '',
  "date_created" date NOT NULL DEFAULT '0000-00-00',
  "date_act_msg" date NOT NULL DEFAULT '0000-00-00' COMMENT 'date last activate msg sent',
  "title" varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY ("id")
) AUTO_INCREMENT=237;



#
# Table structure for table 'user_address'
#

CREATE TABLE /*!32312 IF NOT EXISTS*/ "user_address" (
  "id" mediumint(9) NOT NULL DEFAULT '0',
  "address" int(11) NOT NULL DEFAULT '0',
  "date_to" date NOT NULL DEFAULT '0000-00-00',
  "date_from" date NOT NULL DEFAULT '0000-00-00' COMMENT 'date address active from',
  "seq" tinyint(4) NOT NULL DEFAULT '0',
  "address_type" char(2) NOT NULL DEFAULT '',
  PRIMARY KEY ("id","address","date_to","date_from","seq")
) COMMENT='User address';



#
# Table structure for table 'user_address_details'
#

CREATE TABLE /*!32312 IF NOT EXISTS*/ "user_address_details" (
  "address" int(11) NOT NULL AUTO_INCREMENT,
  "street" varchar(40) NOT NULL DEFAULT '',
  "apt_num" varchar(10) NOT NULL DEFAULT '',
  "floor" varchar(3) NOT NULL DEFAULT '',
  "line2" varchar(40) NOT NULL DEFAULT '',
  "line3" varchar(40) NOT NULL DEFAULT '',
  "line4" varchar(40) NOT NULL DEFAULT '',
  "city" varchar(40) NOT NULL DEFAULT '',
  "state" varchar(10) NOT NULL DEFAULT '',
  "zip" varchar(10) NOT NULL DEFAULT '',
  "country" varchar(3) NOT NULL DEFAULT '',
  PRIMARY KEY ("address")
) AUTO_INCREMENT=237 COMMENT='Address';



#
# Table structure for table 'user_phone'
#

CREATE TABLE /*!32312 IF NOT EXISTS*/ "user_phone" (
  "id" mediumint(9) NOT NULL DEFAULT '0',
  "date_to" date NOT NULL DEFAULT '0000-00-00',
  "date_from" date NOT NULL DEFAULT '0000-00-00',
  "seq" tinyint(4) NOT NULL DEFAULT '0',
  "phone_type" char(1) NOT NULL DEFAULT '',
  "country_code" varchar(4) NOT NULL DEFAULT '',
  "area_code" varchar(8) NOT NULL DEFAULT '',
  "number" varchar(12) NOT NULL DEFAULT '',
  "extension" varchar(7) NOT NULL DEFAULT '',
  "default" char(1) NOT NULL DEFAULT '',
  "sms_ok" char(1) NOT NULL DEFAULT '',
  "msg_ok" char(1) NOT NULL DEFAULT '',
  "fax_ok" char(1) NOT NULL DEFAULT '',
  "workflow_ok" char(1) NOT NULL DEFAULT '',
  "always_answer" char(1) NOT NULL DEFAULT '' COMMENT 'contact this number first',
  "personal" char(1) NOT NULL DEFAULT '' COMMENT 'personal/official ',
  PRIMARY KEY ("id","date_to","date_from","seq")
) COMMENT='User phone';

