Skip to content

Instantly share code, notes, and snippets.

@prodeveloper
Created September 11, 2014 00:10
Show Gist options
  • Save prodeveloper/9b1aa406ece0dd843a80 to your computer and use it in GitHub Desktop.
Save prodeveloper/9b1aa406ece0dd843a80 to your computer and use it in GitHub Desktop.
Users Table Structure
CREATE TABLE'users' (
'id' int(10) unsigned NOT NULL AUTO_INCREMENT,
'password' text COLLATE utf8_unicode_ci NOT NULL,
'email' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY ('id')
)
CREATE TABLE 'location' (
'id' int(10) unsigned NOT NULL AUTO_INCREMENT,
'city' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'state' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'zip' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'users_id' int(10) unsigned NOT NULL,
PRIMARY KEY ('id')
)
CREATE TABLE'users' (
'id' int(10) unsigned NOT NULL AUTO_INCREMENT,
'firstname' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
'lastname' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
'password' text COLLATE utf8_unicode_ci NOT NULL,
'email' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
'city' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'state' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'zip' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
'phonenumber' varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
'role' enum('normal','administrator') COLLATE utf8_unicode_ci DEFAULT NULL,
'verified' tinyint(1) DEFAULT NULL,
'verification_link' varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
'remember_token' varchar(100) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY ('id')
)
CREATE TABLE'personal_info' (
'id' int(10) unsigned NOT NULL AUTO_INCREMENT,
'firstname' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
'lastname' varchar(45) COLLATE utf8_unicode_ci NOT NULL,
'users_id' int(10) unsigned NOT NULL,
PRIMARY KEY ('id')
)
CREATE TABLE 'roles' (
'id' int(10) unsigned NOT NULL AUTO_INCREMENT,
'role' enum('normal','administrator') COLLATE utf8_unicode_ci DEFAULT NULL,
'users_id' int(10) unsigned NOT NULL,
PRIMARY KEY ('id')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment