Skip to content

Commit

Permalink
Extend UNIQUE constraint by new server column, to avoid possible coll…
Browse files Browse the repository at this point in the history
…isions
  • Loading branch information
DarkFenX committed Feb 26, 2024
1 parent b8a58fc commit fb45736
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions eos/db/saveddata/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now))

sso_table = Table("ssoCharacter", saveddata_meta,
Column("ID", Integer, primary_key=True),
Column("client", String, nullable=False),
Column("characterID", Integer, nullable=False),
Column("characterName", String, nullable=False),
Column("server", String, nullable=False),
Column("refreshToken", String, nullable=False),
Column("accessToken", String, nullable=False),
Column("accessTokenExpires", DateTime, nullable=False),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
UniqueConstraint('client', 'characterID', name='uix_client_characterID'),
UniqueConstraint('client', 'characterName', name='uix_client_characterName')
)
Column("ID", Integer, primary_key=True),
Column("client", String, nullable=False),
Column("characterID", Integer, nullable=False),
Column("characterName", String, nullable=False),
Column("server", String, nullable=False),
Column("refreshToken", String, nullable=False),
Column("accessToken", String, nullable=False),
Column("accessTokenExpires", DateTime, nullable=False),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
UniqueConstraint('client', 'server', 'characterID', name='uix_client_server_characterID'),
UniqueConstraint('client', 'server', 'characterName', name='uix_client_server_characterName'))

sso_character_map_table = Table("ssoCharacterMap", saveddata_meta,
Column("characterID", ForeignKey("characters.ID"), primary_key=True),
Expand Down

0 comments on commit fb45736

Please sign in to comment.