Skip to content

Database Schema

Josh Earlenbaugh edited this page Nov 19, 2017 · 8 revisions

The database schema for Agora is structured as follows (I do not list updated-at or created-at columns here, but each table have these columns in implementation):

  • users

    • id: integer
    • username: string
    • password_digest: string
    • session_token: string
  • questions

    • id: integer
    • user_id: integer, null: false, unique: true
    • title: string, null: false
    • body: text, null: false
    • topic: string
    • tag: string
  • answers

    • id: integer
    • user_id: integer, null: false
    • question_id: integer, null: false
    • title: string, null: false
    • body: text, null: false
  • comments

    • id: integer
    • user_id: integer, null_false
    • answer_id: integer, null_false
    • title: string, null_false
    • body: text, null_false

Back to Table of Contents...

Clone this wiki locally