# 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_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;

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;



