9/15/09

Planning the database

Db
I decided that database will be consist from the following tables:

  • surveys
    This table stores all the surveys, their description and their ID number 
  • questions
    In this table will be placed all the questions of each survey
  • answers
    This table contains all answers of each questions (One question may have 1- many answers)
  • users_answers
    In This table i will gather all the answers that user made when he answered the survey.
    (after the answerer press the 'submit' - each answer will be inserted as row into this table along with user_id and answer_id from answers table)
Some of my blog devoted readers may ask: Where is the users table? Well,  right, there must be. But lets speak about it later...

Some other planning stuff
There are some rules i decided to place here, because they have thight inflence on database:

  1. Each user can answer each survey only once.
  2. Published surveys cannot be editable.
  3. all answers checked by user will be stored with it's answer id and user id in row at user_answers table.
    (It means that only after user marked all the answers and pressed the 'submit button' the answers will be inserted to database)

Getting started with docker

It is very simple to get started usig docker. All you need to do-is download the docker desktop for your system Once you get docker syste...