mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
1ae35fdb1f
I had originally thought we would have new tables for `companies` and `brands` but we're going to use the existing `participants` table. Instead, this adds a `type` column to `participants` which is an ENUM with three values: individual, group, and open group. Individuals will behave as participants currently do. Groups will say "We are" instead of "I am" but will otherwise be the same. Open groups will be where we go into all of the voting to decide how to split up the money.
26 lines
1.2 KiB
Python
26 lines
1.2 KiB
Python
from gittip.orm import db
|
|
from sqlalchemy.schema import Column, ForeignKey
|
|
from sqlalchemy.types import BigInteger, Numeric, Text, TIMESTAMP
|
|
|
|
|
|
class Identification(db.Model):
|
|
__tablename__ = 'identifications'
|
|
|
|
id = Column(BigInteger, nullable=False, primary_key=True)
|
|
ctime = Column(TIMESTAMP(timezone=True), nullable=False)
|
|
mtime = Column(TIMESTAMP(timezone=True), nullable=False, default="now()")
|
|
|
|
individual = Column(Text, ForeignKey( "participants.username"
|
|
, onupdate="CASCADE"
|
|
, ondelete="RESTRICT"
|
|
), nullable=False)
|
|
group = Column(Text, ForeignKey( "participants.username"
|
|
, onupdate="CASCADE"
|
|
, ondelete="RESTRICT"
|
|
), nullable=False)
|
|
weight = Column(Numeric(precision=17, scale=16), nullable=False)
|
|
identified_by = Column(Text, ForeignKey( "participants.username"
|
|
, onupdate="CASCADE"
|
|
, ondelete="RESTRICT"
|
|
), nullable=False)
|