feat(db): add an index for SSHPubKeys.PubKey

Speeds up SSHPubKeys.PubKey searches in a larger database.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-08-12 21:37:34 -07:00
parent 913ce8a4f0
commit 1a7f6e1fa9
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 52 additions and 0 deletions

View file

@ -87,6 +87,7 @@ SSHPubKeys = Table(
Column('UserID', ForeignKey('Users.ID', ondelete='CASCADE'), nullable=False),
Column('Fingerprint', String(44), primary_key=True),
Column('PubKey', String(4096), nullable=False),
Index('SSHPubKeysPubKey', 'PubKey'),
mysql_engine='InnoDB', mysql_charset='utf8mb4', mysql_collate='utf8mb4_bin',
)