PageRenderTime 184ms CodeModel.GetById 61ms app.highlight 17ms RepoModel.GetById 103ms app.codeStats 1ms

/users/tables.sql

http://showslow.googlecode.com/
SQL | 201 lines | 142 code | 23 blank | 36 comment | 0 complexity | 4e44200a30dfadc056878e17ef2f8631 MD5 | raw file
  1-- MySQL dump 10.13  Distrib 5.1.49, for pc-linux-gnu (i686)
  2--
  3-- Host: localhost    Database: userbase 
  4-- ------------------------------------------------------
  5-- Server version	5.1.49
  6
  7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
 10/*!40101 SET NAMES utf8 */;
 11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
 12/*!40103 SET TIME_ZONE='+00:00' */;
 13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
 14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
 15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
 16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
 17
 18--
 19-- Table structure for table `3f7f6ece338d68f7fbd069377de434e0_db_version`
 20--
 21
 22DROP TABLE IF EXISTS `3f7f6ece338d68f7fbd069377de434e0_db_version`;
 23/*!40101 SET @saved_cs_client     = @@character_set_client */;
 24/*!40101 SET character_set_client = utf8 */;
 25CREATE TABLE `3f7f6ece338d68f7fbd069377de434e0_db_version` (
 26  `version` int(10) unsigned NOT NULL DEFAULT '1',
 27  PRIMARY KEY (`version`)
 28) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 29/*!40101 SET character_set_client = @saved_cs_client */;
 30
 31--
 32-- Table structure for table `u_account_users`
 33--
 34
 35DROP TABLE IF EXISTS `u_account_users`;
 36/*!40101 SET @saved_cs_client     = @@character_set_client */;
 37/*!40101 SET character_set_client = utf8 */;
 38CREATE TABLE `u_account_users` (
 39  `account_id` int(10) unsigned NOT NULL DEFAULT '0',
 40  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
 41  `role` tinyint(4) unsigned NOT NULL DEFAULT '0',
 42  KEY `user_account` (`account_id`),
 43  KEY `account_user` (`user_id`),
 44  CONSTRAINT `account_user` FOREIGN KEY (`user_id`) REFERENCES `u_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
 45  CONSTRAINT `u_account_users_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `u_accounts` (`id`),
 46  CONSTRAINT `u_account_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `u_users` (`id`)
 47) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 48/*!40101 SET character_set_client = @saved_cs_client */;
 49
 50--
 51-- Table structure for table `u_accounts`
 52--
 53
 54DROP TABLE IF EXISTS `u_accounts`;
 55/*!40101 SET @saved_cs_client     = @@character_set_client */;
 56/*!40101 SET character_set_client = utf8 */;
 57CREATE TABLE `u_accounts` (
 58  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 59  `name` text,
 60  `plan` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Payment plan ID',
 61  PRIMARY KEY (`id`)
 62) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=latin1;
 63/*!40101 SET character_set_client = @saved_cs_client */;
 64
 65--
 66-- Table structure for table `u_activity`
 67--
 68
 69DROP TABLE IF EXISTS `u_activity`;
 70/*!40101 SET @saved_cs_client     = @@character_set_client */;
 71/*!40101 SET character_set_client = utf8 */;
 72CREATE TABLE `u_activity` (
 73  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Time of activity',
 74  `user_id` int(10) unsigned NOT NULL COMMENT 'User ID',
 75  `activity_id` int(2) unsigned NOT NULL COMMENT 'Activity ID',
 76  KEY `time` (`time`),
 77  KEY `user_id` (`user_id`),
 78  KEY `activity_id` (`activity_id`)
 79) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Stores user activities';
 80/*!40101 SET character_set_client = @saved_cs_client */;
 81
 82--
 83-- Table structure for table `u_googlefriendconnect`
 84--
 85
 86DROP TABLE IF EXISTS `u_googlefriendconnect`;
 87/*!40101 SET @saved_cs_client     = @@character_set_client */;
 88/*!40101 SET character_set_client = utf8 */;
 89CREATE TABLE `u_googlefriendconnect` (
 90  `user_id` int(10) unsigned NOT NULL COMMENT 'User ID',
 91  `google_id` varchar(255) NOT NULL COMMENT 'Google Friend Connect ID',
 92  `userpic` text NOT NULL COMMENT 'Google Friend Connect User picture',
 93  PRIMARY KEY (`user_id`,`google_id`),
 94  CONSTRAINT `gfc_user` FOREIGN KEY (`user_id`) REFERENCES `u_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
 95) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 96/*!40101 SET character_set_client = @saved_cs_client */;
 97
 98--
 99-- Table structure for table `u_invitation`
100--
101
102DROP TABLE IF EXISTS `u_invitation`;
103/*!40101 SET @saved_cs_client     = @@character_set_client */;
104/*!40101 SET character_set_client = utf8 */;
105CREATE TABLE `u_invitation` (
106  `code` char(10) NOT NULL COMMENT 'Code',
107  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When invitation was created',
108  `issuedby` bigint(10) unsigned NOT NULL DEFAULT '1' COMMENT 'User who issued the invitation. Default is Sergey.',
109  `sentto` text COMMENT 'Note about who this invitation was sent to',
110  `user` bigint(10) unsigned DEFAULT NULL COMMENT 'User name',
111  PRIMARY KEY (`code`)
112) ENGINE=InnoDB DEFAULT CHARSET=latin1;
113/*!40101 SET character_set_client = @saved_cs_client */;
114
115--
116-- Table structure for table `u_oid_associations`
117--
118
119DROP TABLE IF EXISTS `u_oid_associations`;
120/*!40101 SET @saved_cs_client     = @@character_set_client */;
121/*!40101 SET character_set_client = utf8 */;
122CREATE TABLE `u_oid_associations` (
123  `server_url` blob NOT NULL,
124  `handle` varchar(255) NOT NULL DEFAULT '',
125  `secret` blob NOT NULL,
126  `issued` int(11) NOT NULL DEFAULT '0',
127  `lifetime` int(11) NOT NULL DEFAULT '0',
128  `assoc_type` varchar(64) NOT NULL DEFAULT '',
129  PRIMARY KEY (`server_url`(255),`handle`)
130) ENGINE=InnoDB DEFAULT CHARSET=latin1;
131/*!40101 SET character_set_client = @saved_cs_client */;
132
133--
134-- Table structure for table `u_oid_nonces`
135--
136
137DROP TABLE IF EXISTS `u_oid_nonces`;
138/*!40101 SET @saved_cs_client     = @@character_set_client */;
139/*!40101 SET character_set_client = utf8 */;
140CREATE TABLE `u_oid_nonces` (
141  `server_url` text NOT NULL,
142  `timestamp` int(11) NOT NULL DEFAULT '0',
143  `salt` varchar(40) NOT NULL DEFAULT '',
144  UNIQUE KEY `server_url` (`server_url`(255),`timestamp`,`salt`)
145) ENGINE=InnoDB DEFAULT CHARSET=latin1;
146/*!40101 SET character_set_client = @saved_cs_client */;
147
148--
149-- Table structure for table `u_user_preferences`
150--
151
152DROP TABLE IF EXISTS `u_user_preferences`;
153/*!40101 SET @saved_cs_client     = @@character_set_client */;
154/*!40101 SET character_set_client = utf8 */;
155CREATE TABLE `u_user_preferences` (
156  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
157  `current_account_id` int(10) unsigned DEFAULT NULL,
158  PRIMARY KEY (`user_id`),
159  KEY `preference_current_account` (`current_account_id`),
160  CONSTRAINT `preference_user` FOREIGN KEY (`user_id`) REFERENCES `u_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
161  CONSTRAINT `u_user_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `u_users` (`id`),
162  CONSTRAINT `u_user_preferences_ibfk_2` FOREIGN KEY (`current_account_id`) REFERENCES `u_accounts` (`id`)
163) ENGINE=InnoDB DEFAULT CHARSET=latin1;
164/*!40101 SET character_set_client = @saved_cs_client */;
165
166--
167-- Table structure for table `u_users`
168--
169
170DROP TABLE IF EXISTS `u_users`;
171/*!40101 SET @saved_cs_client     = @@character_set_client */;
172/*!40101 SET character_set_client = utf8 */;
173CREATE TABLE `u_users` (
174  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
175  `regtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Time of registration',
176  `name` text NOT NULL,
177  `username` varchar(25) DEFAULT NULL,
178  `email` varchar(320) DEFAULT NULL,
179  `pass` varchar(40) NOT NULL COMMENT 'Password digest',
180  `salt` varchar(13) NOT NULL COMMENT 'Salt',
181  `temppass` varchar(13) DEFAULT NULL COMMENT 'Temporary password used for password recovery',
182  `temppasstime` timestamp NULL DEFAULT NULL COMMENT 'Temporary password generation time',
183  `requirespassreset` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Flag indicating that user must reset their password before using the site',
184  `fb_id` bigint(20) unsigned DEFAULT NULL COMMENT 'Facebook user ID',
185  PRIMARY KEY (`id`),
186  UNIQUE KEY `username` (`username`),
187  UNIQUE KEY `email` (`email`),
188  UNIQUE KEY `fb_id` (`fb_id`)
189) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1;
190/*!40101 SET character_set_client = @saved_cs_client */;
191/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
192
193/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
194/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
195/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
196/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
197/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
198/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
199/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
200
201-- Dump completed on 2010-10-17  2:18:12