Files
Chad Whitacre b67c222ce0 Clean up Goal model a bit; #141
The Goal model is only needed right now by the test suite, and there
only to ensure that the database is torn down properly. I'm actually a
little nervous having this object around, because the `goals` table
should be considered immutable. Harumph.
2013-04-03 11:19:10 -04:00

21 lines
763 B
Python

from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, Numeric, Text, TIMESTAMP
from gittip.orm import db
class Goal(db.Model):
__tablename__ = 'goals'
id = Column(Integer, nullable=False, primary_key=True)
ctime = Column(TIMESTAMP(timezone=True), nullable=False)
mtime = Column(TIMESTAMP(timezone=True), nullable=False, default="now()")
participant = Column(Text
, ForeignKey( "participants.id"
, onupdate="CASCADE"
, ondelete="RESTRICT"
)
, nullable=False
)
goal = Column(Numeric(precision=35, scale=2), nullable=True)