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