Skip to content

Instantly share code, notes, and snippets.

@naan
Created August 4, 2010 06:51
Show Gist options
  • Save naan/507759 to your computer and use it in GitHub Desktop.
Save naan/507759 to your computer and use it in GitHub Desktop.
DROP TABLE IF EXISTS home_timeline_%d;
CREATE TABLE home_timeline_%d (
'status_id' INTEGER PRIMARY KEY,
'favorited' INTEGER
);
DROP TABLE IF EXISTS mentions_%d;
CREATE TABLE mentions_%d (
'status_id' INTEGER PRIMARY KEY,
'favorited' INTEGER
);
DROP TABLE IF EXISTS following_%d;
CREATE TABLE following_%d (
'user_id' INTEGER PRIMARY KEY
);
DROP TABLE IF EXISTS direct_messages_%d;
CREATE TABLE direct_messages_%d (
'id' INTEGER PRIMARY KEY,
'sender_id' INTEGER,
'recipient_id' INTEGER,
'text' TEXT,
'created_at' INTEGER,
'sender_screen_name' TEXT,
'recipient_screen_name' TEXT
);
DROP INDEX IF EXISTS direct_messages_%d_sender_id;
DROP INDEX IF EXISTS direct_messages_%d_recipient_id;
CREATE INDEX direct_messages_%d_sender_id on direct_messages_%d(sender_id);
CREATE INDEX direct_messages_%d_recipient_id on direct_messages_%d(recipient_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment