# SQL Manager 2007 for MySQL 4.1.2.1
# ---------------------------------------
# Host     : localhost
# Port     : 3306
# Database : designcom




#
# Structure for the `fst_account` table : 
#


CREATE TABLE `fst_account` (
  `id` int(11) NOT NULL auto_increment,
  `key_name` varchar(255) default NULL,
  `name` varchar(255) default NULL,
  `description` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

#
# Structure for the `fst_features` table : 
#


CREATE TABLE `fst_features` (
  `id` int(11) NOT NULL auto_increment,
  `key_name` varchar(255) NOT NULL,
  `name` varchar(255) default NULL,
  `value` varchar(255) default NULL,
  `description` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

#
# Structure for the `fst_account_features` table : 
#


CREATE TABLE `fst_account_features` (
  `id` int(11) NOT NULL auto_increment,
  `account_id` int(11) default NULL,
  `features_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `account_id` (`account_id`),
  KEY `features_id` (`features_id`),
  CONSTRAINT `fst_account_features_fk` FOREIGN KEY (`account_id`) REFERENCES `fst_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fst_account_features_fk1` FOREIGN KEY (`features_id`) REFERENCES `fst_features` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

#
# Structure for the `fst_user` table : 
#


CREATE TABLE `fst_user` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(255) default NULL,
  `password` varchar(255) default NULL,
  `email` varchar(255) default NULL,
  `created_at` datetime default NULL,
  `sesscode` varchar(32) default NULL,
  `last_login` datetime default NULL,
  `now` datetime default NULL,
  `is_active` tinyint(1) default '0',
  `domain` varchar(255) default NULL,
  `pic` varchar(255) default NULL,
  `name` varchar(255) default NULL,
  `surname` varchar(255) default NULL,
  `birthday` date default NULL,
  `country_id` int(11) default NULL,
  `region_id` int(11) default NULL,
  `city_id` int(11) default NULL,
  `experience` int(5) default NULL,
  `about_me` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;

#
# Structure for the `fst_user_account` table : 
#


CREATE TABLE `fst_user_account` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) default NULL,
  `account_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `user_id` (`user_id`),
  KEY `account_id` (`account_id`),
  CONSTRAINT `fst_user_account_fk` FOREIGN KEY (`user_id`) REFERENCES `fst_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fst_user_account_fk1` FOREIGN KEY (`account_id`) REFERENCES `fst_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

#
# Structure for the `fst_user_features` table : 
#


CREATE TABLE `fst_user_features` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) default NULL,
  `features_id` int(11) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `user_id` (`user_id`),
  KEY `features_id` (`features_id`),
  CONSTRAINT `fst_user_features_fk` FOREIGN KEY (`user_id`) REFERENCES `fst_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fst_user_features_fk1` FOREIGN KEY (`features_id`) REFERENCES `fst_features` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

#
# Data for the `fst_account` table  (LIMIT 0,500)
#

INSERT INTO `fst_account` (`id`, `key_name`, `name`, `description`) VALUES 
  (1,'vip','VIP',NULL);

COMMIT;

#
# Data for the `fst_features` table  (LIMIT 0,500)
#

INSERT INTO `fst_features` (`id`, `key_name`, `name`, `value`, `description`) VALUES 
  (1,'portfolio_crop','Обрезание фоток',NULL,NULL),
  (2,'comment_edit',NULL,NULL,NULL),
  (3,'sdfsdfsdf',NULL,NULL,NULL);

COMMIT;

#
# Data for the `fst_account_features` table  (LIMIT 0,500)
#

INSERT INTO `fst_account_features` (`id`, `account_id`, `features_id`) VALUES 
  (1,1,1);

COMMIT;

#
# Data for the `fst_user` table  (LIMIT 0,500)
#

INSERT INTO `fst_user` (`id`, `username`, `password`, `email`, `created_at`, `sesscode`, `last_login`, `now`, `is_active`, `domain`, `pic`, `name`, `surname`, `birthday`, `country_id`, `region_id`, `city_id`, `experience`, `about_me`) VALUES 
  (1,'FaStY','c8837b23ff8aaa8a2dde915473ce0991','fasty_t@yahoo.com','2008-10-03 19:32:30','ac1dec7949a94115d13a1784092fca36','2008-11-30 01:13:11','2008-11-30 01:37:52',0,'egor','4ea81b456d6522e3b7e95d11f940c4ce.jpg','Егор','Дмитрук','1988-04-27',8,48,333,3,'sfsdf\r\nsdfsdfdd'),
  (27,'FaStYs','698d51a19d8a121ce581499d7b701668','admin@admin.com','2008-10-10 22:12:29',NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
  (28,'Mash','c8837b23ff8aaa8a2dde915473ce0991','mash@mash.ru','2008-10-26 00:09:08','37310a4a7c91e02ce22b505be3741cb7',NULL,'2008-10-26 00:17:33',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

COMMIT;

#
# Data for the `fst_user_account` table  (LIMIT 0,500)
#

INSERT INTO `fst_user_account` (`id`, `user_id`, `account_id`) VALUES 
  (1,1,1);

COMMIT;

#
# Data for the `fst_user_features` table  (LIMIT 0,500)
#

INSERT INTO `fst_user_features` (`id`, `user_id`, `features_id`) VALUES 
  (1,1,2);

COMMIT;



