Stamp book data models

This commit is contained in:
Ben 2019-03-18 15:58:30 +00:00
parent ae06207a00
commit b5a80bb27f

35
Houdini/Data/Stamp.py Normal file
View File

@ -0,0 +1,35 @@
from Houdini.Data import db
class Stamp(db.Model):
__tablename__ = 'stamp'
ID = db.Column(db.Integer, primary_key=True)
Name = db.Column(db.String(50), nullable=False)
GroupID = db.Column(db.ForeignKey('stamp_group.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
Rank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
Description = db.Column(db.String(255), nullable=False, server_default=db.text("''::character varying"))
class StampGroup(db.Model):
__tablename__ = 'stamp_group'
ID = db.Column(db.Integer, primary_key=True)
Name = db.Column(db.String(50), nullable=False)
ParentID = db.Column(db.ForeignKey('stamp_group.ID', ondelete='CASCADE', onupdate='CASCADE'))
class CoverStamp(db.Model):
__tablename__ = 'cover_stamp'
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
nullable=False)
StampID = db.Column(db.ForeignKey('stamp.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
nullable=False)
ItemID = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
X = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
Y = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
Type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
Rotation = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
Depth = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))