Skip to content

Instantly share code, notes, and snippets.

@ozten
Created August 17, 2012 20:07
Show Gist options
  • Select an option

  • Save ozten/3382151 to your computer and use it in GitHub Desktop.

Select an option

Save ozten/3382151 to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS user (id BIGINT AUTO_INCREMENT PRIMARY KEY,passwd CHAR(64),lastPasswordReset TIMESTAMP DEFAULT 0 NOT NULL) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS email (id BIGINT AUTO_INCREMENT PRIMARY KEY,user BIGINT NOT NULL,address VARCHAR(255) UNIQUE NOT NULL,type ENUM('secondary', 'primary') DEFAULT 'secondary' NOT NULL,verified BOOLEAN DEFAULT TRUE NOT NULL, FOREIGN KEY user_fkey (user) REFERENCES user(id)) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS staged (id BIGINT AUTO_INCREMENT PRIMARY KEY,secret CHAR(48) UNIQUE NOT NULL,new_acct BOOL NOT NULL,existing_user BIGINT,email VARCHAR(255) UNIQUE NOT NULL,passwd CHAR(64),ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,FOREIGN KEY existing_user_fkey (existing_user) REFERENCES user(id)) ENGINE=InnoDB;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment