mirror of
https://github.com/solero/houdini.git
synced 2024-11-25 15:07:24 +00:00
All column names are now lowercase
This commit is contained in:
parent
094ee97f4d
commit
3c09434012
1676
houdini.sql
1676
houdini.sql
File diff suppressed because it is too large
Load Diff
@ -56,16 +56,16 @@ class PenguinStringCompiler(OrderedDict):
|
||||
@classmethod
|
||||
def setup_default_builder(cls, string_builder):
|
||||
string_builder.update({
|
||||
'ID': PenguinStringCompiler.data_attribute_by_name('ID'),
|
||||
'Nickname': PenguinStringCompiler.attribute_by_name('Nickname'),
|
||||
'Approval': PenguinStringCompiler.attribute_by_name('approval'),
|
||||
'Color': PenguinStringCompiler.data_attribute_by_name('Color'),
|
||||
'Head': PenguinStringCompiler.data_attribute_by_name('Head'),
|
||||
'Face': PenguinStringCompiler.data_attribute_by_name('Face'),
|
||||
'Neck': PenguinStringCompiler.data_attribute_by_name('Neck'),
|
||||
'Body': PenguinStringCompiler.data_attribute_by_name('Body'),
|
||||
'Hand': PenguinStringCompiler.data_attribute_by_name('Name'),
|
||||
'Photo': PenguinStringCompiler.data_attribute_by_name('Photo'),
|
||||
'ID': PenguinStringCompiler.data_attribute_by_name('id'),
|
||||
'Nickname': PenguinStringCompiler.attribute_by_name('nickname'),
|
||||
'Approval': PenguinStringCompiler.data_attribute_by_name('approval'),
|
||||
'Color': PenguinStringCompiler.data_attribute_by_name('color'),
|
||||
'Head': PenguinStringCompiler.data_attribute_by_name('head'),
|
||||
'Face': PenguinStringCompiler.data_attribute_by_name('face'),
|
||||
'Neck': PenguinStringCompiler.data_attribute_by_name('neck'),
|
||||
'Body': PenguinStringCompiler.data_attribute_by_name('body'),
|
||||
'Hand': PenguinStringCompiler.data_attribute_by_name('hand'),
|
||||
'Photo': PenguinStringCompiler.data_attribute_by_name('photo'),
|
||||
'X': PenguinStringCompiler.attribute_by_name('x'),
|
||||
'Y': PenguinStringCompiler.attribute_by_name('y'),
|
||||
'Frame': PenguinStringCompiler.attribute_by_name('frame'),
|
||||
@ -80,14 +80,14 @@ class PenguinStringCompiler(OrderedDict):
|
||||
@classmethod
|
||||
def setup_anonymous_default_builder(cls, string_builder):
|
||||
string_builder.update({
|
||||
'ID': PenguinStringCompiler.attribute_by_name('ID'),
|
||||
'Nickname': PenguinStringCompiler.attribute_by_name('Nickname'),
|
||||
'ID': PenguinStringCompiler.attribute_by_name('id'),
|
||||
'Nickname': PenguinStringCompiler.attribute_by_name('nickname'),
|
||||
'Approval': PenguinStringCompiler.attribute_by_name('approval'),
|
||||
'Color': PenguinStringCompiler.attribute_by_name('Color'),
|
||||
'Head': PenguinStringCompiler.attribute_by_name('Head'),
|
||||
'Face': PenguinStringCompiler.attribute_by_name('Face'),
|
||||
'Neck': PenguinStringCompiler.attribute_by_name('Neck'),
|
||||
'Body': PenguinStringCompiler.attribute_by_name('Body'),
|
||||
'Hand': PenguinStringCompiler.attribute_by_name('Name'),
|
||||
'Photo': PenguinStringCompiler.attribute_by_name('Photo')
|
||||
'Color': PenguinStringCompiler.attribute_by_name('color'),
|
||||
'Head': PenguinStringCompiler.attribute_by_name('head'),
|
||||
'Face': PenguinStringCompiler.attribute_by_name('face'),
|
||||
'Neck': PenguinStringCompiler.attribute_by_name('neck'),
|
||||
'Body': PenguinStringCompiler.attribute_by_name('body'),
|
||||
'Hand': PenguinStringCompiler.attribute_by_name('name'),
|
||||
'Photo': PenguinStringCompiler.attribute_by_name('photo')
|
||||
})
|
||||
|
@ -4,44 +4,41 @@ from houdini.data import db
|
||||
class BuddyList(db.Model):
|
||||
__tablename__ = 'buddy_list'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
BuddyID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
BestBuddy = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
buddy_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
best_buddy = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
t_buddy_request = db.Table(
|
||||
'buddy_request', db,
|
||||
db.Column('PenguinID', db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('RequesterID', db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class BuddyRequest(db.Model):
|
||||
__tablename__ = 'buddy_request'
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
requester_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
t_ignore_list = db.Table(
|
||||
'ignore_list', db,
|
||||
db.Column('PenguinID', db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('IgnoreID', db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
)
|
||||
class IgnoreList(db.Model):
|
||||
__tablename__ = 'ignore_list'
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
ignore_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
|
||||
|
||||
class Character(db.Model):
|
||||
__tablename__ = 'character'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(30), nullable=False)
|
||||
GiftID = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
StampID = db.Column(db.ForeignKey('stamp.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(30), nullable=False)
|
||||
gift_id = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
stamp_id = db.Column(db.ForeignKey('stamp.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
|
||||
|
||||
t_character_buddy = db.Table(
|
||||
'character_buddy', db,
|
||||
db.Column('PenguinID', db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('CharacterID', db.ForeignKey('character.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class CharacterBuddy(db.Model):
|
||||
__tablename__ = 'character_buddy'
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
character_id = db.Column(db.ForeignKey('character.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
@ -4,7 +4,7 @@ from houdini.data import db
|
||||
class DanceSong(db.Model):
|
||||
__tablename__ = 'dance_song'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(30), nullable=False)
|
||||
SongLength = db.Column(db.Integer, nullable=False, server_default=db.text("100000"))
|
||||
MillisPerBar = db.Column(db.Integer, nullable=False, server_default=db.text("2000"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(30), nullable=False)
|
||||
song_length = db.Column(db.Integer, nullable=False, server_default=db.text("100000"))
|
||||
millis_per_bar = db.Column(db.Integer, nullable=False, server_default=db.text("2000"))
|
||||
|
@ -1,72 +1,72 @@
|
||||
from houdini.data import db, BaseCrumbsCollection
|
||||
from houdini.data.penguin import PenguinIgloo, PenguinLocation, PenguinFurniture
|
||||
from houdini.data.penguin import PenguinIgloo, PenguinLocation, PenguinFurniture, PenguinFlooring
|
||||
|
||||
|
||||
class Flooring(db.Model):
|
||||
__tablename__ = 'flooring'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50))
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50))
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class Furniture(db.Model):
|
||||
__tablename__ = 'furniture'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
Type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
Sort = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Bait = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
MaxQuantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
sort = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
bait = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
max_quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
|
||||
|
||||
class Igloo(db.Model):
|
||||
__tablename__ = 'igloo'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
Cost = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
Patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
cost = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class IglooFurniture(db.Model):
|
||||
__tablename__ = 'igloo_furniture'
|
||||
|
||||
IglooID = db.Column(db.ForeignKey('penguin_igloo_room.ID', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False, index=True)
|
||||
FurnitureID = db.Column(db.ForeignKey('furniture.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
X = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
Y = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
Frame = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
Rotation = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
igloo_id = db.Column(db.ForeignKey('penguin_igloo_room.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False, index=True)
|
||||
furniture_id = db.Column(db.ForeignKey('furniture.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
x = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
y = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
frame = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
rotation = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
|
||||
|
||||
class IglooLike(db.Model):
|
||||
__tablename__ = 'igloo_like'
|
||||
|
||||
IglooID = db.Column(db.ForeignKey('penguin_igloo_room.ID', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
OwnerID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
PlayerID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
igloo_id = db.Column(db.ForeignKey('penguin_igloo_room.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
owner_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Count = db.Column(db.SmallInteger, nullable=False)
|
||||
Date = db.Column(db.Date, nullable=False, server_default=db.text("now()"))
|
||||
player_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
count = db.Column(db.SmallInteger, nullable=False)
|
||||
date = db.Column(db.Date, nullable=False, server_default=db.text("now()"))
|
||||
|
||||
|
||||
class Location(db.Model):
|
||||
__tablename__ = 'location'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class IglooCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -5,16 +5,16 @@ from houdini.data.penguin import PenguinItem
|
||||
class Item(db.Model):
|
||||
__tablename__ = 'item'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50))
|
||||
Type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Bait = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
EPF = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Tour = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ReleaseDate = db.Column(db.Date, nullable=False, server_default=db.text("now()"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50))
|
||||
type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
bait = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
patched = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
epf = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
tour = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
release_date = db.Column(db.Date, nullable=False, server_default=db.text("now()"))
|
||||
|
||||
|
||||
class ItemCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -5,10 +5,10 @@ from houdini.data.penguin import PenguinPostcard
|
||||
class Postcard(db.Model):
|
||||
__tablename__ = 'postcard'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("10"))
|
||||
Enabled = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("10"))
|
||||
enabled = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PostcardCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -4,34 +4,34 @@ from houdini.data import db
|
||||
class Ban(db.Model):
|
||||
__tablename__ = 'ban'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Issued = db.Column(db.DateTime, primary_key=True, nullable=False, server_default=db.text("now()"))
|
||||
Expires = db.Column(db.DateTime, primary_key=True, nullable=False, server_default=db.text("now()"))
|
||||
ModeratorID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
Reason = db.Column(db.SmallInteger, nullable=False)
|
||||
Comment = db.Column(db.Text)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
issued = db.Column(db.DateTime, primary_key=True, nullable=False, server_default=db.text("now()"))
|
||||
expires = db.Column(db.DateTime, primary_key=True, nullable=False, server_default=db.text("now()"))
|
||||
moderator_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
reason = db.Column(db.SmallInteger, nullable=False)
|
||||
comment = db.Column(db.Text)
|
||||
|
||||
|
||||
class Warning(db.Model):
|
||||
__tablename__ = 'warning'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Issued = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
Expires = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
Type = db.Column(db.SmallInteger, nullable=False)
|
||||
Comment = db.Column(db.Text, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
issued = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
expires = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
type = db.Column(db.SmallInteger, nullable=False)
|
||||
comment = db.Column(db.Text, nullable=False)
|
||||
|
||||
|
||||
class Report(db.Model):
|
||||
__tablename__ = 'report'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"report_ID_seq\"'::regclass)"))
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
ReporterID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
ReportType = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
Date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
ServerID = db.Column(db.Integer, nullable=False)
|
||||
RoomID = db.Column(db.ForeignKey('room.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"report_ID_seq\"'::regclass)"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
reporter_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
report_type = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
server_id = db.Column(db.Integer, nullable=False)
|
||||
room_id = db.Column(db.ForeignKey('room.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
|
||||
|
@ -4,19 +4,19 @@ from houdini.data import db
|
||||
class PenguinTrack(db.Model):
|
||||
__tablename__ = 'penguin_track'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_track_ID_seq\"'::regclass)"))
|
||||
Name = db.Column(db.String(12), nullable=False, server_default=db.text("''::character varying"))
|
||||
OwnerID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Sharing = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Pattern = db.Column(db.Text, nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_track_id_seq\"'::regclass)"))
|
||||
name = db.Column(db.String(12), nullable=False, server_default=db.text("''::character varying"))
|
||||
owner_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
sharing = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
pattern = db.Column(db.Text, nullable=False)
|
||||
|
||||
|
||||
class TrackLike(db.Model):
|
||||
__tablename__ = 'track_like'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
TrackID = db.Column(db.ForeignKey('penguin_track.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
Date = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
track_id = db.Column(db.ForeignKey('penguin_track.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
date = db.Column(db.DateTime, primary_key=True, nullable=False)
|
@ -5,14 +5,14 @@ from houdini.data.penguin import PenguinCard
|
||||
class Card(db.Model):
|
||||
__tablename__ = 'card'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
SetID = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
PowerID = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
Element = db.Column(db.CHAR(1), nullable=False, server_default=db.text("'s'::bpchar"))
|
||||
Color = db.Column(db.CHAR(1), nullable=False, server_default=db.text("'b'::bpchar"))
|
||||
Value = db.Column(db.SmallInteger, nullable=False, server_default=db.text("2"))
|
||||
Description = db.Column(db.String(255), nullable=False, server_default=db.text("''::character varying"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
set_id = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
power_id = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
element = db.Column(db.CHAR(1), nullable=False, server_default=db.text("'s'::bpchar"))
|
||||
color = db.Column(db.CHAR(1), nullable=False, server_default=db.text("'b'::bpchar"))
|
||||
value = db.Column(db.SmallInteger, nullable=False, server_default=db.text("2"))
|
||||
description = db.Column(db.String(255), nullable=False, server_default=db.text("''::character varying"))
|
||||
|
||||
|
||||
class CardCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -4,251 +4,260 @@ from houdini.data import db
|
||||
class Penguin(db.Model):
|
||||
__tablename__ = 'penguin'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"penguin_ID_seq\"'::regclass)"))
|
||||
Username = db.Column(db.String(12), nullable=False, unique=True)
|
||||
Nickname = db.Column(db.String(30), nullable=False)
|
||||
Password = db.Column(db.CHAR(60), nullable=False)
|
||||
Email = db.Column(db.String(255), nullable=False, index=True)
|
||||
RegistrationDate = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
Active = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
SafeChat = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
LastPaycheck = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
MinutesPlayed = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Moderator = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Character = db.Column(db.ForeignKey('character.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Igloo = db.Column(db.ForeignKey('penguin_igloo_room.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Coins = db.Column(db.Integer, nullable=False, server_default=db.text("500"))
|
||||
Color = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Head = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Face = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Neck = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Body = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Hand = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Feet = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Photo = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Flag = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Permaban = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
BookModified = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
BookColor = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
BookHighlight = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
BookPattern = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
BookIcon = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
AgentStatus = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
FieldOpStatus = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
CareerMedals = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
AgentMedals = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
LastFieldOp = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
NinjaRank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
NinjaProgress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
FireNinjaRank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
FireNinjaProgress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
WaterNinjaRank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
WaterNinjaProgress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
NinjaMatchesWon = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
FireMatchesWon = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
WaterMatchesWon = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
RainbowAdoptability = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
HasDug = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Nuggets = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
TimerActive = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
TimerStart = db.Column(db.Time, nullable=False, server_default=db.text("'00:00:00'::time without time zone"))
|
||||
TimerEnd = db.Column(db.Time, nullable=False, server_default=db.text("'23:59:59'::time without time zone"))
|
||||
ApprovalEn = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ApprovalPt = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ApprovalFr = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ApprovalEs = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ApprovalDe = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
ApprovalRu = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionEn = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionPt = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionFr = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionEs = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionDe = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
RejectionRu = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"penguin_id_seq\"'::regclass)"))
|
||||
username = db.Column(db.String(12), nullable=False, unique=True)
|
||||
nickname = db.Column(db.String(30), nullable=False)
|
||||
password = db.Column(db.CHAR(60), nullable=False)
|
||||
email = db.Column(db.String(255), nullable=False, index=True)
|
||||
registration_date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
active = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
safe_chat = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
last_paycheck = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
minutes_played = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
moderator = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
character = db.Column(db.ForeignKey('character.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
igloo = db.Column(db.ForeignKey('penguin_igloo_room.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
coins = db.Column(db.Integer, nullable=False, server_default=db.text("500"))
|
||||
color = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
head = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
face = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
neck = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
body = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
hand = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
feet = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
photo = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
flag = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
permaban = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
book_modified = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
book_color = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
book_highlight = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
book_pattern = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
book_icon = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
agent_status = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
field_op_status = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
career_medals = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
agent_medals = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
last_field_op = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
ninja_rank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
ninja_progress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
fire_ninja_rank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
fire_ninja_progress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
water_ninja_rank = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
water_ninja_progress = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
ninja_matches_won = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
fire_matches_won = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
water_matches_won = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
rainbow_adoptability = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
has_dug = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
nuggets = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
timer_active = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
timer_start = db.Column(db.Time, nullable=False, server_default=db.text("'00:00:00'::time without time zone"))
|
||||
timer_end = db.Column(db.Time, nullable=False, server_default=db.text("'23:59:59'::time without time zone"))
|
||||
approval_en = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
approval_pt = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
approval_fr = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
approval_es = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
approval_de = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
approval_ru = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_en = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_pt = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_fr = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_es = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_de = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
rejection_ru = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
@property
|
||||
def approval(self):
|
||||
return int('{}{}0{}{}{}{}'.format(self.ApprovalRu * 1, self.ApprovalDe * 1, self.ApprovalEs * 1,
|
||||
self.ApprovalFr * 1, self.ApprovalPt * 1, self.ApprovalEn * 1), 2)
|
||||
return int('{}{}0{}{}{}{}'.format(self.approval_ru * 1, self.approval_de * 1, self.approval_es * 1,
|
||||
self.approval_fr * 1, self.approval_pt * 1, self.approval_en * 1), 2)
|
||||
|
||||
@property
|
||||
def rejection(self):
|
||||
return int('{}{}0{}{}{}{}'.format(self.RejectionRu * 1, self.RejectionDe * 1, self.RejectionEs * 1,
|
||||
self.RejectionFr * 1, self.RejectionPt * 1, self.RejectionEn * 1), 2)
|
||||
return int('{}{}0{}{}{}{}'.format(self.rejection_ru * 1, self.rejection_de * 1, self.rejection_es * 1,
|
||||
self.rejection_fr * 1, self.rejection_pt * 1, self.rejection_en * 1), 2)
|
||||
|
||||
|
||||
class ActivationKey(db.Model):
|
||||
__tablename__ = 'activation_key'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
ActivationKey = db.Column(db.CHAR(255), primary_key=True, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
activation_key = db.Column(db.CHAR(255), primary_key=True, nullable=False)
|
||||
|
||||
|
||||
class PuffleQuest(db.Model):
|
||||
__tablename__ = 'puffle_quest'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
TaskID = db.Column(db.SmallInteger, primary_key=True, nullable=False)
|
||||
CompletionDate = db.Column(db.DateTime)
|
||||
ItemCollected = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
CoinsCollected = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
task_id = db.Column(db.SmallInteger, primary_key=True, nullable=False)
|
||||
completion_date = db.Column(db.DateTime)
|
||||
item_collected = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
coins_collected = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PenguinIgloo(db.Model):
|
||||
__tablename__ = 'penguin_igloo'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
IglooID = db.Column(db.ForeignKey('igloo.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
igloo_id = db.Column(db.ForeignKey('igloo.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class PenguinItem(db.Model):
|
||||
__tablename__ = 'penguin_item'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
ItemID = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
item_id = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
|
||||
|
||||
class PenguinLocation(db.Model):
|
||||
__tablename__ = 'penguin_location'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
LocationID = db.Column(db.ForeignKey('location.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
location_id = db.Column(db.ForeignKey('location.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class PenguinStamp(db.Model):
|
||||
__tablename__ = 'penguin_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)
|
||||
Recent = db.Column(db.Boolean, nullable=False, server_default=db.text("true"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
stamp_id = db.Column(db.ForeignKey('stamp.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
recent = db.Column(db.Boolean, nullable=False, server_default=db.text("true"))
|
||||
|
||||
|
||||
class PenguinRedemption(db.Model):
|
||||
__tablename__ = 'penguin_redemption'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
CodeID = db.Column(db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
BookID = db.Column(db.ForeignKey('redemption_book.ID', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
book_id = db.Column(db.ForeignKey('redemption_book.id', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
|
||||
|
||||
class PenguinMembership(db.Model):
|
||||
__tablename__ = 'penguin_membership'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Start = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
End = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
start = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
expires = db.Column(db.DateTime, primary_key=True, nullable=False)
|
||||
|
||||
|
||||
class PenguinPostcard(db.Model):
|
||||
__tablename__ = 'penguin_postcard'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_postcard_ID_seq\"'::regclass)"))
|
||||
SenderID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
RecipientID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False,
|
||||
index=True)
|
||||
PostcardID = db.Column(db.ForeignKey('postcard.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
SendDate = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
Details = db.Column(db.String(255), nullable=False, server_default=db.text("''::character varying"))
|
||||
HasRead = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_postcard_id_seq\"'::regclass)"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False,
|
||||
index=True)
|
||||
sender_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), index=True)
|
||||
postcard_id = db.Column(db.ForeignKey('postcard.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
send_date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
details = db.Column(db.String(255), nullable=False, server_default=db.text("''::character varying"))
|
||||
has_read = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PenguinIglooRoom(db.Model):
|
||||
__tablename__ = 'penguin_igloo_room'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_igloo_room_ID_seq\"'::regclass)"))
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Type = db.Column(db.ForeignKey('igloo.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Flooring = db.Column(db.ForeignKey('flooring.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Music = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
Location = db.Column(db.ForeignKey('location.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Locked = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_igloo_room_id_seq\"'::regclass)"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
type = db.Column(db.ForeignKey('igloo.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
flooring = db.Column(db.ForeignKey('flooring.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
music = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
location = db.Column(db.ForeignKey('location.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
locked = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PenguinLaunchGame(db.Model):
|
||||
__tablename__ = 'penguin_launch_game'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Level = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
PuffleOs = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
BestTime = db.Column(db.SmallInteger, nullable=False, server_default=db.text("600"))
|
||||
Turbo = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
level = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("0"))
|
||||
puffle_os = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
best_time = db.Column(db.SmallInteger, nullable=False, server_default=db.text("600"))
|
||||
turbo = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PenguinCard(db.Model):
|
||||
__tablename__ = 'penguin_card'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
CardID = db.Column(db.ForeignKey('card.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False, index=True)
|
||||
card_id = db.Column(db.ForeignKey('card.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
|
||||
|
||||
class PenguinFurniture(db.Model):
|
||||
__tablename__ = 'penguin_furniture'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
FurnitureID = db.Column(db.ForeignKey('furniture.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
furniture_id = db.Column(db.ForeignKey('furniture.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
|
||||
|
||||
class PenguinFlooring(db.Model):
|
||||
__tablename__ = 'penguin_flooring'
|
||||
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
flooring_id = db.Column(db.ForeignKey('flooring.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
|
||||
|
||||
class PenguinPuffle(db.Model):
|
||||
__tablename__ = 'penguin_puffle'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_puffle_ID_seq\"'::regclass)"))
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Name = db.Column(db.String(16), nullable=False)
|
||||
AdoptionDate = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
Type = db.Column(db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Food = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
Play = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
Rest = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
Clean = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
Walking = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
Hat = db.Column(db.ForeignKey('puffle_item.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Backyard = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
HasDug = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
id = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"penguin_puffle_id_seq\"'::regclass)"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
puffle_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
name = db.Column(db.String(16), nullable=False)
|
||||
adoption_date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
food = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
play = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
rest = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
clean = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
walking = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
hat = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
backyard = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
has_dug = db.Column(db.Boolean, server_default=db.text("false"))
|
||||
|
||||
|
||||
class PenguinPuffleItem(db.Model):
|
||||
__tablename__ = 'penguin_puffle_item'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
ItemID = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
Quantity = db.Column(db.SmallInteger, nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
item_id = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
quantity = db.Column(db.SmallInteger, nullable=False)
|
||||
|
||||
|
||||
class PenguinPermission(db.Model):
|
||||
__tablename__ = 'penguin_permission'
|
||||
|
||||
PenguinID = db.Column(db.ForeignKey(u'penguin.ID', ondelete=u'CASCADE', onupdate=u'CASCADE'), primary_key=True)
|
||||
PermissionID = db.Column(db.ForeignKey(u'permission.ID', ondelete=u'CASCADE', onupdate=u'CASCADE'), nullable=False)
|
||||
penguin_id = db.Column(db.ForeignKey(u'penguin.id', ondelete=u'CASCADE', onupdate=u'CASCADE'), primary_key=True)
|
||||
permission_id = db.Column(db.ForeignKey(u'permission.id', ondelete=u'CASCADE', onupdate=u'CASCADE'), nullable=False)
|
||||
|
||||
|
||||
class Login(db.Model):
|
||||
__tablename__ = 'login'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"login_ID_seq\"'::regclass)"))
|
||||
PenguinID = db.Column(db.ForeignKey('penguin.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
IPAddress = db.Column(db.CHAR(255), nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"login_id_seq\"'::regclass)"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
date = db.Column(db.DateTime, nullable=False, server_default=db.text("now()"))
|
||||
i_p_address = db.Column(db.CHAR(255), nullable=False)
|
||||
|
@ -5,9 +5,9 @@ from houdini.data.penguin import PenguinPermission
|
||||
class Permission(db.Model):
|
||||
__tablename__ = 'permission'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"permission_ID_seq\"'::regclass)"))
|
||||
Name = db.Column(db.String(50), nullable=False, unique=True)
|
||||
Enabled = db.Column(db.Boolean, nullable=False, server_default=db.text("true"))
|
||||
id = db.Column(db.Integer, primary_key=True, server_default=db.text("nextval('\"permission_id_seq\"'::regclass)"))
|
||||
name = db.Column(db.String(50), nullable=False, unique=True)
|
||||
enabled = db.Column(db.Boolean, nullable=False, server_default=db.text("true"))
|
||||
|
||||
|
||||
class PermissionCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -5,59 +5,59 @@ from houdini.data.penguin import PenguinPuffle, PenguinPuffleItem
|
||||
class Puffle(db.Model):
|
||||
__tablename__ = 'puffle'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
ParentID = db.Column(db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Name = db.Column(db.String(50), nullable=False, server_default=db.text("''::character varying"))
|
||||
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
FavouriteFood = db.Column(db.ForeignKey('puffle_item.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
RunawayPostcard = db.Column(db.ForeignKey('postcard.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
MaxFood = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
MaxRest = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
MaxClean = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
parent_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
name = db.Column(db.String(50), nullable=False, server_default=db.text("''::character varying"))
|
||||
member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
favourite_food = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
runaway_postcard = db.Column(db.ForeignKey('postcard.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
max_food = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
max_rest = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
max_clean = db.Column(db.SmallInteger, nullable=False, server_default=db.text("100"))
|
||||
|
||||
|
||||
class PuffleItem(db.Model):
|
||||
__tablename__ = 'puffle_item'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
ParentID = db.Column(db.ForeignKey('puffle_item.ID', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
Name = db.Column(db.String(50), nullable=False, server_default=db.text("''::character varying"))
|
||||
Type = db.Column(db.String(10), nullable=False, server_default=db.text("'care'::character varying"))
|
||||
PlayExternal = db.Column(db.String(10), nullable=False, server_default=db.text("'none'::character varying"))
|
||||
Cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
FoodEffect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
RestEffect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
PlayEffect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
CleanEffect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
parent_id = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'), nullable=False)
|
||||
name = db.Column(db.String(50), nullable=False, server_default=db.text("''::character varying"))
|
||||
type = db.Column(db.String(10), nullable=False, server_default=db.text("'care'::character varying"))
|
||||
play_external = db.Column(db.String(10), nullable=False, server_default=db.text("'none'::character varying"))
|
||||
cost = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
quantity = db.Column(db.SmallInteger, nullable=False, server_default=db.text("1"))
|
||||
member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
food_effect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
rest_effect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
play_effect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
clean_effect = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
|
||||
|
||||
|
||||
class PuffleTreasureFurniture(db.Model):
|
||||
__tablename__ = 'puffle_treasure_furniture'
|
||||
|
||||
PuffleID = db.Column(db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
FurnitureID = db.Column(db.ForeignKey('furniture.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
furniture_id = db.Column(db.ForeignKey('furniture.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class PuffleTreasureItem(db.Model):
|
||||
__tablename__ = 'puffle_treasure_item'
|
||||
|
||||
PuffleID = db.Column(db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
ItemID = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
item_id = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class PuffleTreasurePuffleItem(db.Model):
|
||||
__tablename__ = 'puffle_treasure_puffle_item'
|
||||
|
||||
PuffleID = db.Column(db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
PuffleItemID = db.Column(db.ForeignKey('puffle_item.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_item_id = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
|
||||
|
||||
class PuffleCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -4,92 +4,91 @@ from houdini.data import db
|
||||
class RedemptionBook(db.Model):
|
||||
__tablename__ = 'redemption_book'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
Name = db.Column(db.String(255), nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(255), nullable=False)
|
||||
|
||||
|
||||
class RedemptionBookWord(db.Model):
|
||||
__tablename__ = 'redemption_book_word'
|
||||
|
||||
BookID = db.Column(db.ForeignKey('redemption_book.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Page = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
Line = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
WordNumber = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
Answer = db.Column(db.String(20), nullable=False)
|
||||
book_id = db.Column(db.ForeignKey('redemption_book.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
page = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
line = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
word_number = db.Column(db.SmallInteger, primary_key=True, nullable=False, server_default=db.text("1"))
|
||||
answer = db.Column(db.String(20), nullable=False)
|
||||
|
||||
|
||||
class RedemptionCode(db.Model):
|
||||
__tablename__ = 'redemption_code'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"redemption_code_ID_seq\"'::regclass)"))
|
||||
Code = db.Column(db.String(16), nullable=False, unique=True)
|
||||
Type = db.Column(db.String(8), nullable=False, server_default=db.text("'BLANKET'::character varying"))
|
||||
Coins = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
Expires = db.Column(db.DateTime)
|
||||
id = db.Column(db.Integer, primary_key=True,
|
||||
server_default=db.text("nextval('\"redemption_code_id_seq\"'::regclass)"))
|
||||
code = db.Column(db.String(16), nullable=False, unique=True)
|
||||
type = db.Column(db.String(8), nullable=False, server_default=db.text("'BLANKET'::character varying"))
|
||||
coins = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
|
||||
expires = db.Column(db.DateTime)
|
||||
|
||||
|
||||
t_redemption_award_card = db.Table(
|
||||
'redemption_award_card', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('CardID', db.ForeignKey('card.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class RedemptionAwardCard(db.Model):
|
||||
__tablename__ = 'redemption_award_card'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
card_id = db.Column(db.ForeignKey('card.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
t_redemption_award_flooring = db.Table(
|
||||
'redemption_award_flooring', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('FlooringID', db.ForeignKey('flooring.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
|
||||
t_redemption_award_furniture = db.Table(
|
||||
'redemption_award_furniture', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('FurnitureID', db.ForeignKey('furniture.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class RedemptionAwardFlooring(db.Model):
|
||||
__tablename__ = 'redemption_award_flooring'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
flooring_id = db.Column(db.ForeignKey('flooring.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
t_redemption_award_igloo = db.Table(
|
||||
'redemption_award_igloo', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('IglooID', db.ForeignKey('igloo.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
|
||||
t_redemption_award_item = db.Table(
|
||||
'redemption_award_item', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('ItemID', db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class RedemptionAwardFurniture(db.Model):
|
||||
__tablename__ = 'redemption_award_furniture'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
furniture_id = db.Column(db.ForeignKey('furniture.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
t_redemption_award_location = db.Table(
|
||||
'redemption_award_location', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('LocationID', db.ForeignKey('location.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
|
||||
t_redemption_award_puffle = db.Table(
|
||||
'redemption_award_puffle', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('PuffleID', db.ForeignKey('puffle.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
class RedemptionAwardIgloo(db.Model):
|
||||
__tablename__ = 'redemption_award_igloo'
|
||||
code_id = db.Column('CodeID', db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True,nullable=False)
|
||||
igloo_id = db.Column(db.ForeignKey('igloo.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
t_redemption_award_puffle_item = db.Table(
|
||||
'redemption_award_puffle_item', db,
|
||||
db.Column('CodeID', db.ForeignKey('redemption_code.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False),
|
||||
db.Column('PuffleItemID', db.ForeignKey('puffle_item.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
)
|
||||
|
||||
class RedemptionAwardItem(db.Model):
|
||||
__tablename__ = 'redemption_award_item'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
item_id = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class RedemptionAwardLocation(db.Model):
|
||||
__tablename__ = 'redemption_award_location'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
location_id = db.Column(db.ForeignKey('location.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class RedemptionAwardPuffle(db.Model):
|
||||
__tablename__ = 'redemption_award_puffle'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_id = db.Column(db.ForeignKey('puffle.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
|
||||
|
||||
class RedemptionAwardPuffleItem(db.Model):
|
||||
__tablename__ = 'redemption_award_puffle_item'
|
||||
code_id = db.Column(db.ForeignKey('redemption_code.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
puffle_item_id = db.Column(db.ForeignKey('puffle_item.id', ondelete='CASCADE', onupdate='CASCADE'),
|
||||
primary_key=True, nullable=False)
|
||||
|
@ -4,17 +4,17 @@ from houdini.data import db, BaseCrumbsCollection
|
||||
class Room(db.Model):
|
||||
__tablename__ = 'room'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True)
|
||||
InternalID = db.Column(db.Integer, nullable=False, unique=True,
|
||||
server_default=db.text("nextval('\"room_InternalID_seq\"'::regclass)"))
|
||||
Name = db.Column(db.String(50), nullable=False)
|
||||
Member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
MaxUsers = db.Column(db.SmallInteger, nullable=False, server_default=db.text("80"))
|
||||
RequiredItem = db.Column(db.ForeignKey('item.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
Game = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Blackhole = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
Spawn = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
StampGroup = db.Column(db.ForeignKey('stamp_group.ID', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
internal_id = db.Column(db.Integer, nullable=False, unique=True,
|
||||
server_default=db.text("nextval('\"room_internal_id_seq\"'::regclass)"))
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
member = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
max_users = db.Column(db.SmallInteger, nullable=False, server_default=db.text("80"))
|
||||
required_item = db.Column(db.ForeignKey('item.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
game = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
blackhole = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
spawn = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
|
||||
stamp_group = db.Column(db.ForeignKey('stamp_group.id', ondelete='CASCADE', onupdate='CASCADE'))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
@ -50,10 +50,10 @@ class Room(db.Model):
|
||||
class RoomTable(db.Model):
|
||||
__tablename__ = 'room_table'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
RoomID = db.Column(db.ForeignKey('room.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Game = db.Column(db.String(20), nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
room_id = db.Column(db.ForeignKey('room.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
game = db.Column(db.String(20), nullable=False)
|
||||
|
||||
GameClassMapping = {
|
||||
|
||||
@ -111,11 +111,11 @@ class RoomTable(db.Model):
|
||||
class RoomWaddle(db.Model):
|
||||
__tablename__ = 'room_waddle'
|
||||
|
||||
ID = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
RoomID = db.Column(db.ForeignKey('room.ID', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
Seats = db.Column(db.SmallInteger, nullable=False, server_default=db.text("2"))
|
||||
Game = db.Column(db.String(20), nullable=False)
|
||||
id = db.Column(db.Integer, primary_key=True, nullable=False)
|
||||
room_id = db.Column(db.ForeignKey('room.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
seats = db.Column(db.SmallInteger, nullable=False, server_default=db.text("2"))
|
||||
game = db.Column(db.String(20), nullable=False)
|
||||
|
||||
GameClassMapping = {
|
||||
|
||||
|
@ -5,35 +5,35 @@ from houdini.data.penguin import PenguinStamp
|
||||
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"))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
group_id = 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'))
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(50), nullable=False)
|
||||
parent_id = 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"))
|
||||
penguin_id = db.Column(db.ForeignKey('penguin.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
stamp_id = db.Column(db.ForeignKey('stamp.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True,
|
||||
nullable=False)
|
||||
item_id = 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"))
|
||||
|
||||
|
||||
class StampCrumbsCollection(BaseCrumbsCollection):
|
||||
|
@ -210,5 +210,5 @@ def player_data_attribute(**attrs):
|
||||
|
||||
def player_in_room(*room_ids):
|
||||
def check_room_id(_, p):
|
||||
return p.room.ID in room_ids
|
||||
return p.room.id in room_ids
|
||||
return check(check_room_id)
|
||||
|
@ -1,6 +1,6 @@
|
||||
from houdini import handlers
|
||||
from houdini.handlers import XMLPacket, login
|
||||
from houdini.converters import CredentialsConverter
|
||||
from houdini.converters import Credentials
|
||||
from houdini.data.penguin import Penguin
|
||||
from houdini.data.buddy import BuddyList
|
||||
from houdini.data.moderator import Ban
|
||||
@ -17,21 +17,21 @@ from datetime import datetime
|
||||
|
||||
@handlers.handler(XMLPacket('login'))
|
||||
@handlers.allow_once()
|
||||
async def handle_login(p, credentials: CredentialsConverter):
|
||||
async def handle_login(p, credentials: Credentials):
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
login_timestamp = time.time()
|
||||
username, password = credentials
|
||||
username, password = credentials.username, credentials.password
|
||||
p.logger.info('{} is logging in!'.format(username))
|
||||
|
||||
data = await Penguin.query.where(Penguin.Username == username).gino.first()
|
||||
data = await Penguin.query.where(Penguin.username == username).gino.first()
|
||||
|
||||
if data is None:
|
||||
p.logger.info('{} failed to login: penguin does not exist')
|
||||
await p.send_error_and_disconnect(100)
|
||||
|
||||
password_correct = await loop.run_in_executor(None, bcrypt.checkpw,
|
||||
password.encode('utf-8'), data.Password.encode('utf-8'))
|
||||
password.encode('utf-8'), data.password.encode('utf-8'))
|
||||
|
||||
ip_addr = p.peer_name[0]
|
||||
|
||||
@ -64,16 +64,16 @@ async def handle_login(p, credentials: CredentialsConverter):
|
||||
else:
|
||||
del p.server.login_attempts[ip_addr]
|
||||
|
||||
if not data.Active:
|
||||
if not data.active:
|
||||
return await p.send_error_and_disconnect(900)
|
||||
|
||||
if data.Permaban:
|
||||
if data.permaban:
|
||||
return await p.send_error_and_disconnect(603)
|
||||
|
||||
active_ban = await Ban.query.where(Ban.PenguinID == data.ID and Ban.Expires >= datetime.now()).gino.first()
|
||||
active_ban = await Ban.query.where(Ban.penguin_id == data.id and Ban.expires >= datetime.now()).gino.first()
|
||||
|
||||
if active_ban is not None:
|
||||
hours_left = round((active_ban.Expires - datetime.now()).total_seconds() / 60 / 60)
|
||||
hours_left = round((active_ban.expires - datetime.now()).total_seconds() / 60 / 60)
|
||||
|
||||
if hours_left == 0:
|
||||
return await p.send_error_and_disconnect(602)
|
||||
@ -86,8 +86,10 @@ async def handle_login(p, credentials: CredentialsConverter):
|
||||
login_key = Crypto.hash(random_key[::-1])
|
||||
confirmation_hash = Crypto.hash(os.urandom(24))
|
||||
|
||||
await p.server.redis.setex('{}.lkey'.format(data.ID), p.server.server_config['KeyTTL'], login_key)
|
||||
await p.server.redis.setex('{}.ckey'.format(data.ID), p.server.server_config['KeyTTL'], confirmation_hash)
|
||||
tr = p.server.redis.multi_exec()
|
||||
tr.setex('{}.lkey'.format(data.id), p.server.server_config['KeyTTL'], login_key)
|
||||
tr.setex('{}.ckey'.format(data.id), p.server.server_config['KeyTTL'], confirmation_hash)
|
||||
await tr.execute()
|
||||
|
||||
buddy_worlds = []
|
||||
world_populations = []
|
||||
@ -97,8 +99,9 @@ async def handle_login(p, credentials: CredentialsConverter):
|
||||
for server_name, server_config in servers_config.items():
|
||||
if server_config['World']:
|
||||
server_population = await p.server.redis.get('{}.population'.format(server_name))
|
||||
server_population = (7 if int(server_population) == server_config['Capacity'] \
|
||||
else int(server_population) / (server_config['Capacity'] / 6)) if server_population else 0
|
||||
server_population = (7 if int(server_population) == server_config['Capacity']
|
||||
else int(server_population) / (server_config['Capacity'] / 6)) \
|
||||
if server_population else 0
|
||||
|
||||
server_players = await p.server.redis.smembers('{}.players'.format(server_name))
|
||||
|
||||
@ -114,9 +117,10 @@ async def handle_login(p, credentials: CredentialsConverter):
|
||||
buddy_worlds.append(server_config['Id'])
|
||||
break
|
||||
|
||||
raw_login_data = '|'.join([str(data.ID), str(data.ID), data.Username, login_key, str(data.approval),
|
||||
raw_login_data = '|'.join([str(data.id), str(data.id), data.username, login_key, str(data.approval),
|
||||
str(data.rejection)])
|
||||
await p.send_xt('l', raw_login_data, confirmation_hash, '', '|'.join(world_populations), '|'.join(buddy_worlds), data.Email)
|
||||
await p.send_xt('l', raw_login_data, confirmation_hash, '', '|'.join(world_populations), '|'.join(buddy_worlds),
|
||||
data.email)
|
||||
|
||||
handle_version_check = login.handle_version_check
|
||||
handle_random_key = login.handle_random_key
|
||||
|
@ -57,5 +57,5 @@ class Penguin(Spheniscidae):
|
||||
|
||||
def __repr__(self):
|
||||
if self.data is not None:
|
||||
return '<Penguin ID=\'{}\' Username=\'{}\'>'.format(self.data.ID, self.data.Username)
|
||||
return '<Penguin ID=\'{}\' Username=\'{}\'>'.format(self.data.id, self.data.username)
|
||||
return super().__repr__()
|
||||
|
Loading…
Reference in New Issue
Block a user