-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Isaac Dontje Lindell edited this page Oct 3, 2013
·
16 revisions
Welcome to the TapVote wiki!
Here is our proposal: TapVote proposal
To set up a test database on Ubuntu (maybe all *nix?):
$ sudo apt-get install postgresql-
$ sudo -u postgres psql postgres. Connects to the newly installed Postgres server using the defaultpostgresdatabase -
# \password postgres. Will prompt you for a password. Probably should usewearetapvotefor now. # create database tapvotetest;-
CTRL-Dto exit psql. -
$ sudo -u postgres psql tapvotetest. Connect to the newly createdtapvotetestdatabase. - Create the schema:
CREATE TABLE survey (
id integer PRIMARY KEY,
title text
);
CREATE TABLE vote (
questionId integer REFERENCES question(id),
answerId integer REFERENCES answer(id)
);
CREATE TABLE question (
id integer PRIMARY KEY,
surveyId integer REFERENCES survey(id),
value text
);
CREATE TABLE answer (
id integer PRIMARY KEY,
questionId integer REFERENCES question(id) ,
value text
);
The connection string used to connect to the database using Node.js is:
var CONNSTRING = "postgres://postgres:wearetapvote@localhost/tapvotetest";