Dreimiller

ConfirmAccount.sql

Jan 4th, 2012
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.30 KB | None | 0 0
  1. -- (c) Aaron Schulz, 2007
  2.  
  3. -- Table structure for table `Confirm account`
  4. -- Replace /*$wgDBprefix*/ with the proper prefix
  5.  
  6. -- This stores all of our reviews,
  7. -- the corresponding tags are stored in the tag table
  8. CREATE TABLE IF NOT EXISTS /*_*/account_requests (
  9.   acr_id int unsigned NOT NULL auto_increment PRIMARY KEY,
  10.   -- Usernames must be unique, must not be in the form of
  11.   -- an IP address. _Shouldn't_ allow slashes or case
  12.   -- conflicts. Spaces are allowed, and are _not_ converted
  13.   -- to underscores like titles. See the User::newFromName() for
  14.   -- the specific tests that usernames have to pass.
  15.   acr_name varchar(255) binary NOT NULL default '',
  16.   -- Optional 'real name' to be displayed in credit listings
  17.   acr_real_name varchar(255) binary NOT NULL default '',
  18.   -- Note: email should be restricted, not public info.
  19.   -- Same with passwords.
  20.   acr_email tinytext NOT NULL,
  21.   -- Initially NULL; when a user's e-mail address has been
  22.   -- validated by returning with a mailed token, this is
  23.   -- set to the current timestamp.
  24.   acr_email_authenticated binary(14) default NULL,
  25.   -- Randomly generated token created when the e-mail address
  26.   -- is set and a confirmation test mail sent.
  27.   acr_email_token binary(32),
  28.   -- Expiration date for the user_email_token
  29.   acr_email_token_expires binary(14),
  30.   -- A little about this user
  31.   acr_bio mediumblob NOT NULL,
  32.   -- Private info for reviewers to look at when considering request
  33.   acr_notes mediumblob NOT NULL,
  34.   -- Links to recognize/identify this user, CSV, may not be public
  35.   acr_urls mediumblob NOT NULL,
  36.   -- IP address
  37.   acr_ip VARCHAR(255) NULL default '',
  38.   -- Name of attached file (.pdf,.doc,.txt etc...)
  39.   acr_filename VARCHAR(255) NULL,
  40.   acr_storage_key VARCHAR(64) NULL,
  41.   -- Prospective account access level
  42.   acr_type tinyint(255) unsigned NOT NULL default 0,
  43.   -- Areas of interest
  44.   acr_areas mediumblob NOT NULL,
  45.  
  46.   -- Timestamp of account registration.
  47.   acr_registration char(14) NOT NULL,
  48.  
  49.   -- Flag for rejected accounts
  50.   acr_deleted bool NOT NULL,
  51.   -- Time of rejection (if rejected)
  52.   acr_rejected binary(14),
  53.   -- Time request was put on hold (if held)
  54.   acr_held binary(14),
  55.   -- The user who rejected/held it
  56.   acr_user int unsigned NOT NULL default 0,
  57.   -- Reason
  58.   acr_comment varchar(255) NOT NULL default ''
  59. ) /*$wgDBTableOptions*/;
  60.  
  61. CREATE UNIQUE INDEX /*i*/acr_name ON /*_*/account_requests (acr_name);
  62. CREATE UNIQUE INDEX /*i*/acr_email ON /*_*/account_requests (acr_email(255));
  63. CREATE INDEX /*i*/acr_email_token ON /*_*/account_requests (acr_email_token);
  64. CREATE INDEX /*i*/acr_type_del_reg ON /*_*/account_requests (acr_type,acr_deleted,acr_registration);
  65.  
  66. -- This stores all of credential information
  67. -- When accounts are confirmed, the identity info goes here
  68. CREATE TABLE IF NOT EXISTS /*_*/account_credentials (
  69.   -- Revision ID #
  70.   acd_id int unsigned NOT NULL auto_increment PRIMARY KEY,
  71.   -- Foreign key to user.user_id
  72.   acd_user_id int unsigned NOT NULL,
  73.   -- Optional 'real name' to be displayed in credit listings
  74.   acd_real_name varchar(255) binary NOT NULL default '',
  75.   -- Note: email should be restricted, not public info.
  76.   -- Same with passwords.
  77.   acd_email tinytext NOT NULL,
  78.   -- Initially NULL; when a user's e-mail address has been
  79.   -- validated by returning with a mailed token, this is
  80.   -- set to the current timestamp.
  81.   acd_email_authenticated binary(14) default NULL,
  82.   -- A little about this user
  83.   acd_bio mediumblob NOT NULL,
  84.   -- Private info for reviewers to look at when considering request
  85.   acd_notes mediumblob NOT NULL,
  86.   -- Links to recognize/identify this user, CSV, may not be public
  87.   acd_urls mediumblob NOT NULL,
  88.   -- IP address
  89.   acd_ip VARCHAR(255) NULL default '',
  90.   -- Name of attached file (.pdf,.doc,.txt etc...)
  91.   acd_filename VARCHAR(255) NULL,
  92.   acd_storage_key VARCHAR(64) NULL,
  93.   -- Areas of interest
  94.   acd_areas mediumblob NOT NULL,
  95.  
  96.   -- Timestamp of account registration.
  97.   acd_registration char(14) NOT NULL,
  98.  
  99.   -- Timestamp of acceptance
  100.   acd_accepted binary(14),
  101.   -- The user who accepted it
  102.   acd_user int unsigned NOT NULL default 0,
  103.   -- Reason given in email
  104.   acd_comment varchar(255) NOT NULL default ''
  105. ) /*$wgDBTableOptions*/;
  106.  
  107. CREATE UNIQUE INDEX /*i*/acd_user_id ON /*_*/account_credentials (acd_user_id,acd_id);
Advertisement
Add Comment
Please, Sign In to add comment