Skip to content

Commit

Permalink
fixed manually
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentq committed Apr 1, 2011
2 parents e0d5f90 + bfcf100 commit 55d245c
Show file tree
Hide file tree
Showing 15 changed files with 773 additions and 256 deletions.
1 change: 1 addition & 0 deletions db/fixtures/dbSetup.sql
Expand Up @@ -10,4 +10,5 @@
.read ./fixtures/follows.sql
.read ./fixtures/updateIssueVotes.sql
.read ./fixtures/messages.sql
.read ./fixtures/followedUsers.sql
.quit
1 change: 1 addition & 0 deletions db/fixtures/followedUsers.sql
@@ -0,0 +1 @@
INSERT INTO followed_users (id, follower_user_id, user_id) VALUES (1, 2, 1);
81 changes: 44 additions & 37 deletions db/fixtures/schema.sql
@@ -1,46 +1,46 @@
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT NOT NULL,
facebook_account TEXT,
twitter_account TEXT,
password TEXT NOT NULL,
neighborhood TEXT,
postal_code TEXT,
website TEXT,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
reputation_score INTEGER,
isEditor INTEGER
);
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT NOT NULL,
facebook_account TEXT,
twitter_account TEXT,
password TEXT NOT NULL,
neighborhood TEXT,
postal_code TEXT,
website TEXT,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
reputation_score INTEGER,
isEditor INTEGER
);

DROP TABLE IF EXISTS issues;
CREATE TABLE issues (
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
user_id INTEGER NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
lastModified DATETIME DEFAULT CURRENT_TIMESTAMP,
status TEXT,
title TEXT,
description TEXT,
link TEXT,
location TEXT,
likes INTEGER,
dislikes INTEGER,
views INTEGER
fileLocation TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
user_id INTEGER NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
lastModified DATETIME DEFAULT CURRENT_TIMESTAMP,
status TEXT,
title TEXT,
description TEXT,
link TEXT,
location TEXT,
likes INTEGER,
dislikes INTEGER,
views INTEGER
fileLocation TEXT
);

DROP TABLE IF EXISTS comments;
CREATE TABLE comments (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
issue_id INTEGER NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
content TEXT,
likes INTEGER DEFAULT 0,
dislikes INTEGER DEFAULT 0
);
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
issue_id INTEGER NOT NULL,
created DATETIME DEFAULT CURRENT_TIMESTAMP,
content TEXT,
likes INTEGER DEFAULT 0,
dislikes INTEGER DEFAULT 0
);

DROP TABLE IF EXISTS tags;
CREATE TABLE tags (
Expand Down Expand Up @@ -68,6 +68,13 @@ CREATE TABLE follows (
user_id INTEGER NOT NULL,
issue_id INTEGER NOT NULL
);

DROP TABLE IF EXISTS followed_users;
CREATE TABLE followed_users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
follower_user_id INTEGER NOT NULL,
user_id INTEGER NOT NULL
);

DROP TABLE IF EXISTS interests;
CREATE TABLE interests (
Expand Down Expand Up @@ -103,9 +110,9 @@ CREATE TABLE sent_msgs (
-- Table used for storing the user votes on comments
DROP TABLE IF EXISTS cmntvotes;
CREATE TABLE cmntvotes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
comment_id INTEGER NOT NULL
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
comment_id INTEGER NOT NULL
);

DROP TABLE IF EXISTS sessions;
Expand Down
14 changes: 6 additions & 8 deletions lib/routes.js
@@ -1,4 +1,4 @@
/*
/* route.js
* Add new routes to the router
*
* Route paths can be either strings or regular expressions.
Expand All @@ -11,7 +11,6 @@
var Router = require('./router').Router;
var ViewIssue = require('viewIssue').ViewIssue;
var ViewProfile = require('viewProfile').ViewProfile;
var TestModule = require('testModule').TestModule;
var EditIssue = require('editIssue').EditIssue;
var SaveIssue = require('saveIssue').SaveIssue;
var signupModule = require('signupModule').SignupModule;
Expand All @@ -25,7 +24,7 @@ var SaveInterest = require('saveInterest').SaveInterest;
var PersonalFeed = require('personalFeed');
var MessageCenter = require('messageInterface');
var VoteComments = require('voteComments').VoteComments;

var followUser = require('followUser');
var Autocomplete = require('autocomplete').Autocomplete;
var GetTags = require('getTags').GetTags;
var SearchTagIssue = require('searchTagIssue').SearchTagIssue;
Expand All @@ -39,27 +38,26 @@ var r = new Router();
/*
* Define routes here!
*/
r.add('/', ListIssues.display);
r.add('/signup', signupModule.handleSignup);
r.add('/editProfile', editProfileModule.buildEditProfilePage);
r.add('/saveInterest', SaveInterest.handleSave);
r.add('/handleEditProfile', editProfileModule.handleEditProfile);
r.add('/foo', TestModule.foo);
r.add('/fooBar', TestModule.fooBar);
r.add('/viewIssue', ViewIssue.display);
r.add('/getTags', GetTags.search);
r.add('/addcomments', ViewIssue.addcomments)
r.add('/followIssue', FollowIssue.followIssue);
r.add('/unfollowIssue', FollowIssue.unfollowIssue);
r.add('/followUser', followUser.follow);
r.add('/unfollowUser', followUser.unfollow);
r.add('/listIssues', ListIssues.display);
r.add('/listTagIssues', SearchTagIssue.display);
r.add('/viewProfile', ViewProfile.display);
r.add('/editIssue', EditIssue.display);
r.add('/saveIssue', SaveIssue.display);
r.add('/index.html', ListIssues.display);
r.add('/', ListIssues.display);
r.add('/voteIssues', VoteIssues.display);
r.add(/^\/home$/, 'about.html');
r.add('/static', 'static.html');
r.add('/fieldValidations.js', 'fieldValidations.js');
r.add('/add', AddIssue.add);
r.add('/addIssue', AddIssue.display);
r.add('/signin', signInModule.signin);
Expand Down
1 change: 0 additions & 1 deletion node_modules/dbAccess.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions node_modules/followUser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55d245c

Please sign in to comment.