forked from gratipay/gratipay.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for funding-goals-over-time; gratipay#141
TODO: * Tests * Migration of current `goal` field to goals table entry for each user * Removing the `goal` column from participant
- Loading branch information
Christian Wyglendowski
committed
Mar 18, 2013
1 parent
9175929
commit 7a74b7a
Showing
5 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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", | ||
This comment has been minimized.
Sorry, something went wrong. |
||
ondelete="RESTRICT"), nullable=False) | ||
amount = Column(Numeric(precision=35, scale=2), nullable=False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm seeing
onupdate="CASCADE"
here, but not the equivalent SQL below.