from .. import db

class Question(db.Model):
	id = db.Column(db.Integer, primary_key=True)
	text = db.Column(db.String(240), unique=True, index=True)
	answer = db.Column(db.Numeric)
from .. import db

class Question(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    text = db.Column(db.String(240), unique=True, index=True)
    answer = db.Column(db.Numeric)

class Estimate(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    question_id = db.Column(db.Integer, db.ForeignKey('question.id'))    
    lowerbound = db.Column(db.Numeric)
    upperbound = db.Column(db.Numeric)
    created_on = db.Column(db.DateTime, default=db.func.now())
Add model to keep track of users' estimates.
Add model to keep track of users' estimates.

  from .. import db
  
  class Question(db.Model):
- 	id = db.Column(db.Integer, primary_key=True)
+     id = db.Column(db.Integer, primary_key=True)
- 	text = db.Column(db.String(240), unique=True, index=True)
+     text = db.Column(db.String(240), unique=True, index=True)
- 	answer = db.Column(db.Numeric)
+     answer = db.Column(db.Numeric)
+ 
+ class Estimate(db.Model):
+     id = db.Column(db.Integer, primary_key=True)
+     user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
+     question_id = db.Column(db.Integer, db.ForeignKey('question.id'))    
+     lowerbound = db.Column(db.Numeric)
+     upperbound = db.Column(db.Numeric)
+     created_on = db.Column(db.DateTime, default=db.func.now())
Add model to keep track of users' estimates.
## Code Before:
from .. import db

class Question(db.Model):
	id = db.Column(db.Integer, primary_key=True)
	text = db.Column(db.String(240), unique=True, index=True)
	answer = db.Column(db.Numeric)
## Instruction:
Add model to keep track of users' estimates.
## Code After:
from .. import db

class Question(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    text = db.Column(db.String(240), unique=True, index=True)
    answer = db.Column(db.Numeric)

class Estimate(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    question_id = db.Column(db.Integer, db.ForeignKey('question.id'))    
    lowerbound = db.Column(db.Numeric)
    upperbound = db.Column(db.Numeric)
    created_on = db.Column(db.DateTime, default=db.func.now())