Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abraham/352528 to your computer and use it in GitHub Desktop.
Save abraham/352528 to your computer and use it in GitHub Desktop.
Example Twitter database schema
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`name` varchar(140) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(180) default NULL,
`description` varchar(300) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(400) default NULL,
`protected` varchar(5) default NULL,
`followers_count` int(10) unsigned NOT NULL,
`profile_background_color` varchar(8) default NULL,
`profile_text_color` varchar(8) default NULL,
`profile_link_color` varchar(8) default NULL,
`profile_sidebar_fill_color` varchar(8) default NULL,
`profile_sidebar_border_color` varchar(8) default NULL,
`friends_count` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`favourites_count` int(10) unsigned NOT NULL,
`utc_offset` int(10) default NULL,
`time_zone` varchar(120) default NULL,
`profile_background_image_url` varchar(400) default NULL,
`profile_background_tile` varchar(5) default NULL,
`statuses_count` int(10) unsigned default '0',
`status_id` bigint(20) unsigned default '0',
`status_created_at` timestamp NULL default NULL,
`status_text` varchar(300) default NULL,
`status_source` varchar(200) default NULL,
`status_truncated` varchar(5) default NULL,
`status_in_reply_to_status_id` bigint(20) unsigned default NULL,
`status_in_reply_to_user_id` int(10) unsigned default NULL,
`status_favorited` varchar(5) default NULL,
`status_in_reply_to_screen_name` varchar(120) default NULL
PRIMARY KEY (`twitter_id`),
UNIQUE KEY `screen_name` (`screen_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment