add autoincrement to some primary keys
This commit is contained in:
parent
9fcd7c159a
commit
3aae90aab8
@ -11,7 +11,7 @@ class Text(Base):
|
|||||||
|
|
||||||
__tablename__ = 'T_TEXT'
|
__tablename__ = 'T_TEXT'
|
||||||
|
|
||||||
TEXT_ID = Column(Integer, primary_key=True, comment="ID of this specific text. These IDs may be recycled in the future and may only be used for a short time period.")
|
TEXT_ID = Column(Integer, autoincrement=True, primary_key=True, comment="ID of this specific text. These IDs may be recycled in the future and may only be used for a short time period.")
|
||||||
LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Reference to the locale that this text provides")
|
LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Reference to the locale that this text provides")
|
||||||
LANG = Column(VARCHAR(2), comment="lang ID of the text value in this row, e.g FR, EN, ES")
|
LANG = Column(VARCHAR(2), comment="lang ID of the text value in this row, e.g FR, EN, ES")
|
||||||
TEXT = Column(Text, comment="Actual text stored")
|
TEXT = Column(Text, comment="Actual text stored")
|
||||||
@ -39,7 +39,7 @@ class Locale(Base):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__tablename__ = 'T_LOCALE'
|
__tablename__ = 'T_LOCALE'
|
||||||
LID = Column(Integer, primary_key=True, comment="ID of this locale (the other tables references to this with *_LID columns)")
|
LID = Column(Integer, primary_key=True, autoincrement=True, comment="ID of this locale (the other tables references to this with *_LID columns)")
|
||||||
|
|
||||||
def __init__(self, LID):
|
def __init__(self, LID):
|
||||||
self.LID = LID
|
self.LID = LID
|
||||||
@ -57,7 +57,7 @@ class Place(Base):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__tablename__ = 'T_PLACE'
|
__tablename__ = 'T_PLACE'
|
||||||
PLACE_ID = Column(Integer, primary_key=True, comment="ID of this place")
|
PLACE_ID = Column(Integer, primary_key=True, autoincrement=True, comment="ID of this place")
|
||||||
NAME_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Place name")
|
NAME_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Place name")
|
||||||
LOCALE = relationship("Locale")
|
LOCALE = relationship("Locale")
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ class Trait(Base):
|
|||||||
Store reaction types, e.g 'happy', 'sad', without relation with NPCs
|
Store reaction types, e.g 'happy', 'sad', without relation with NPCs
|
||||||
"""
|
"""
|
||||||
__tablename__ = "T_TRAIT"
|
__tablename__ = "T_TRAIT"
|
||||||
TRAIT_ID = Column(Integer, primary_key=True, comment="ID of this trait")
|
TRAIT_ID = Column(Integer, primary_key=True, autoincrement=True, comment="ID of this trait")
|
||||||
NAME_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Name of this trait")
|
NAME_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Name of this trait")
|
||||||
DESC_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Description of this trait")
|
DESC_LID = Column(Integer, ForeignKey("T_LOCALE.LID"), comment="Description of this trait")
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ class Reaction(Base):
|
|||||||
Relation between a NPC and a Trait
|
Relation between a NPC and a Trait
|
||||||
"""
|
"""
|
||||||
__tablename__ = "T_REACTION"
|
__tablename__ = "T_REACTION"
|
||||||
REACTION_ID = Column(Integer, primary_key=True, comment="ID of this reaction")
|
REACTION_ID = Column(Integer, primary_key=True, autoincrement=True, comment="ID of this reaction")
|
||||||
NPC_ID = Column(Integer, ForeignKey("T_NPC.NPC_ID"), primary_key=True, comment="Name of the NPC that will have this reaction")
|
NPC_ID = Column(Integer, ForeignKey("T_NPC.NPC_ID"), primary_key=True, comment="Name of the NPC that will have this reaction")
|
||||||
TRAIT_ID = Column(Integer, ForeignKey("T_TRAIT.TRAIT_ID"), primary_key=True, comment="ID of the trait of this reaction")
|
TRAIT_ID = Column(Integer, ForeignKey("T_TRAIT.TRAIT_ID"), primary_key=True, comment="ID of the trait of this reaction")
|
||||||
NPC = relationship("Npc")
|
NPC = relationship("Npc")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user