Skip to content

Commit

Permalink
Oops, forgot instructions for setting up mysql db.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Trott committed Dec 9, 2009
1 parent c0252fe commit 8bd4b5c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 54 deletions.
8 changes: 6 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ Installing Tiptop

Tiptop itself is pure Perl, but it has a number of dependencies beyond core
Perl. You can guarantee that those dependencies are installed by running the
`Makefile.PL`. Tiptop also requires a MySQL database to store post & user
content locally.
`Makefile.PL`, which will complain for all dependencies that aren't installed.

Tiptop also requires a MySQL database to store post & user content locally.
The schema for that database is in `tiptop.sql`:

mysql -u username tiptop < tiptop.sql


Configuring Tiptop
Expand Down
53 changes: 1 addition & 52 deletions lib/Tiptop/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -237,55 +237,4 @@ HTML
return \%data;
}
1;
__END__
DROP TABLE IF EXISTS asset;
CREATE TABLE asset (
asset_id INTEGER UNSIGNED auto_increment NOT NULL,
api_id VARCHAR(75) NOT NULL,
person_id INTEGER UNSIGNED NOT NULL,
title VARCHAR(255),
content MEDIUMBLOB,
permalink VARCHAR(255),
created DATETIME,
favorite_count INTEGER UNSIGNED,
links_json MEDIUMBLOB,
object_type VARCHAR(15),
PRIMARY KEY (asset_id),
INDEX (api_id),
INDEX (person_id, created),
INDEX (created),
INDEX (favorite_count)
);
DROP TABLE IF EXISTS person;
CREATE TABLE person (
person_id INTEGER UNSIGNED auto_increment NOT NULL,
api_id VARCHAR(18) NOT NULL,
display_name VARCHAR(100),
avatar_uri VARCHAR(255),
PRIMARY KEY (person_id),
INDEX (api_id)
);
DROP TABLE IF EXISTS favorited_by;
CREATE TABLE favorited_by (
asset_id INTEGER UNSIGNED NOT NULL,
person_id INTEGER UNSIGNED NOT NULL,
api_id VARCHAR(53) NOT NULL,
INDEX (asset_id),
UNIQUE (api_id)
);
DROP TABLE IF EXISTS last_event_id;
CREATE TABLE last_event_id (
api_id varchar(34) NOT NULL
);
DROP TABLE IF EXISTS stream;
CREATE TABLE stream (
person_id INTEGER UNSIGNED NOT NULL,
asset_id INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (person_id, asset_id)
);
1;
49 changes: 49 additions & 0 deletions tiptop.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
DROP TABLE IF EXISTS asset;
CREATE TABLE asset (
asset_id INTEGER UNSIGNED auto_increment NOT NULL,
api_id VARCHAR(75) NOT NULL,
person_id INTEGER UNSIGNED NOT NULL,
title VARCHAR(255),
content MEDIUMBLOB,
permalink VARCHAR(255),
created DATETIME,
favorite_count INTEGER UNSIGNED,
links_json MEDIUMBLOB,
object_type VARCHAR(15),
PRIMARY KEY (asset_id),
INDEX (api_id),
INDEX (person_id, created),
INDEX (created),
INDEX (favorite_count)
);

DROP TABLE IF EXISTS person;
CREATE TABLE person (
person_id INTEGER UNSIGNED auto_increment NOT NULL,
api_id VARCHAR(18) NOT NULL,
display_name VARCHAR(100),
avatar_uri VARCHAR(255),
PRIMARY KEY (person_id),
INDEX (api_id)
);

DROP TABLE IF EXISTS favorited_by;
CREATE TABLE favorited_by (
asset_id INTEGER UNSIGNED NOT NULL,
person_id INTEGER UNSIGNED NOT NULL,
api_id VARCHAR(53) NOT NULL,
INDEX (asset_id),
UNIQUE (api_id)
);

DROP TABLE IF EXISTS last_event_id;
CREATE TABLE last_event_id (
api_id varchar(34) NOT NULL
);

DROP TABLE IF EXISTS stream;
CREATE TABLE stream (
person_id INTEGER UNSIGNED NOT NULL,
asset_id INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (person_id, asset_id)
);

0 comments on commit 8bd4b5c

Please sign in to comment.