Skip to content
Isaac Dontje Lindell edited this page Oct 3, 2013 · 16 revisions

Welcome to the TapVote wiki!

Here is our proposal: TapVote proposal

Random Info

Database

To set up a test database on Ubuntu (maybe all *nix?):

  1. $ sudo apt-get install postgresql
  2. $ sudo -u postgres psql postgres. Connects to the newly installed Postgres server using the default postgres database
  3. # \password postgres. Will prompt you for a password. Probably should use wearetapvote for now.
  4. # create database tapvotetest;
  5. CTRL-D to exit psql.
  6. $ sudo -u postgres psql tapvotetest. Connect to the newly created tapvotetest database.
  7. 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";

Clone this wiki locally