mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 07:40:58 +00:00
b67c222ce0
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.
21 lines
763 B
Python
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)
|
|
|