Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 160 lines (138 sloc) 5.36 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
DROP TABLE IF EXISTS `Users`;

CREATE TABLE `Users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `deleted` int(10) unsigned NOT NULL,
  `created` int(10) unsigned NOT NULL,
  `password` char(64) DEFAULT NULL,
  `conf_code` char(24) DEFAULT NULL,
  `uploadbyemail_address` varchar(21) DEFAULT NULL,
  `confirmed` int(10) unsigned NOT NULL,
  `cluster_id` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `by_email` (`email`),
  UNIQUE KEY `by_upload` (`uploadbyemail_address`),
  UNIQUE KEY `by_username` (`username`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `UsersPasswordReset`;

CREATE TABLE `UsersPasswordReset` (
  `user_id` int(10) unsigned NOT NULL,
  `reset_code` char(32) DEFAULT NULL,
  `created` int(10) unsigned NOT NULL,
  UNIQUE KEY `by_code` (`reset_code`),
  KEY `by_user` (`user_id`),
  KEY `by_timestamp` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `FlickrUsers`;

CREATE TABLE `FlickrUsers` (
  `user_id` int(11) UNSIGNED NOT NULL,
  `nsid` varchar(20) NOT NULL,
  `path_alias` varchar(255) NOT NULL,
  `path_alias_taken_by` INT(11) UNSIGNED NOT NULL,
  `username` varchar(255) NOT NULL,
  `auth_token` char(34) NOT NULL,
  `oauth_token` char(34) NOT NULL,
  `oauth_secret` char(34) NOT NULL,
  `token_perms` TINYINT(3) NOT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `by_nsid` (`nsid`),
  KEY `by_path_alias` (`path_alias`),
  KEY `by_auth_token` (`auth_token`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `FlickrUsersPathAliases`;

CREATE TABLE `FlickrUsersPathAliases` (
  `user_id` INT(11) UNSIGNED NOT NULL,
  `path_alias` VARCHAR(255) NOT NULL,
  `redirect_to` VARCHAR(255),
  `created` INT(10) UNSIGNED NOT NULL,
  PRIMARY KEY `by_path_alias` (`path_alias`),
  KEY `by_user` (`user_id`, `created`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `FlickrPhotosLookup`;

CREATE TABLE `FlickrPhotosLookup` (
  `photo_id` BIGINT(20) UNSIGNED NOT NULL,
  `user_id` INT(11) UNSIGNED NOT NULL,
  `deleted` INT(11) UNSIGNED NOT NULL,
  PRIMARY KEY (`photo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `FlickrBackups`;

CREATE TABLE `FlickrBackups` (
  `user_id` int(11) unsigned NOT NULL,
  `type_id` tinyint(3) unsigned NOT NULL,
  `date_created` int(11) unsigned NOT NULL,
  `date_firstupdate` int(11) unsigned NOT NULL,
  `date_lastupdate` int(11) unsigned NOT NULL,
  `disabled` tinyint(3) unsigned NOT NULL,
  `details` tinytext NOT NULL,
  UNIQUE KEY `by_user` (`user_id`,`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `Places`;

CREATE TABLE `Places` (
  `woeid` INT(11) UNSIGNED NOT NULL,
  `flickr_data` TEXT NOT NULL,
  `date_created` INT(11) UNSIGNED NOT NULL,
  PRIMARY KEY (`woeid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `InviteCodes`;

CREATE TABLE `InviteCodes` (
  `code` char(12) CHARACTER SET latin1 NOT NULL,
  `email` varchar(255) CHARACTER SET latin1 NOT NULL,
  `created` int(10) unsigned NOT NULL,
  `redeemed` int(10) unsigned NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `sent` int(10) unsigned NOT NULL,
  `invited_by` int(11) unsigned NOT NULL,
  UNIQUE KEY `by_code` (`code`),
  KEY `by_email` (`email`),
  KEY `by_created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ApiKeys`;

CREATE TABLE `ApiKeys` (
  `id` bigint(20) unsigned NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `role_id` tinyint(3) unsigned NOT NULL,
  `api_key` varchar(40) NOT NULL,
  `app_secret` varchar(64) NOT NULL,
  `app_callback` varchar(255) NOT NULL,
  `created` int(11) unsigned NOT NULL,
  `app_title` varchar(255) NOT NULL,
  `app_description` text NOT NULL,
  `deleted` int(11) unsigned NOT NULL,
  `disabled` int(11) unsigned NOT NULL,
  `last_modified` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `by_key` (`api_key`),
  KEY `by_user` (`user_id`,`deleted`,`created`),
  KEY `by_role` (`role_id`,`deleted`,`created`),
  KEY `by_role` (`role_id`,`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `OAuth2AccessTokens`;

CREATE TABLE `OAuth2AccessTokens` (
  `id` bigint(20) unsigned NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `api_key_id` bigint(20) unsigned NOT NULL,
  `api_key_role_id` tinyint(3) unsigned NOT NULL,
  `access_token` varchar(64) NOT NULL,
  `created` int(11) unsigned NOT NULL,
  `perms` tinyint(3) unsigned NOT NULL,
  `last_modified` int(11) unsigned NOT NULL,
  `expires` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `by_api_key` (`api_key_id`,`expires`,`created`),
  KEY `by_user_key` (`user_id`,`api_key_id`,`expires`, `api_key_role_id`),
  KEY `by_user` (`user_id`,`expires`, `api_key_role_id`),
  KEY `by_token` (`access_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `OAuth2GrantTokens`;

CREATE TABLE `OAuth2GrantTokens` (
  `code` varchar(40) NOT NULL,
  `user_id` int(11) unsigned NOT NULL,
  `api_key_id` varchar(40) NOT NULL,
  `created` int(11) unsigned NOT NULL,
  `perms` tinyint(3) unsigned NOT NULL,
  `ttl` int(11) unsigned NOT NULL,
  PRIMARY KEY (`code`),
  KEY `by_user_key` (`user_id`,`api_key_id`),
  KEY `by_created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Something went wrong with that request. Please try again.