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

This reverts commit 1a7f6e1fa9.

This commit broke account creation in some way. We'd still like to
do this, but we need to ensure it does not intrude on other facets.

Extra: We should really work out how this even passed tests; it
should not have.
This commit is contained in:
Kevin Morris 2022-08-13 19:23:19 -07:00
parent b3d09a4b77
commit 5abd5db313
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 0 additions and 52 deletions

View file

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

View file

@ -1,28 +0,0 @@
"""add SSHPubKeys.PubKey index
Revision ID: dd70103d2e82
Revises: d64e5571bc8d
Create Date: 2022-08-12 21:30:26.155465
"""
import traceback
from alembic import op
# revision identifiers, used by Alembic.
revision = 'dd70103d2e82'
down_revision = 'd64e5571bc8d'
branch_labels = None
depends_on = None
def upgrade():
try:
op.create_index("SSHPubKeysPubKey", "SSHPubKeys", ["PubKey"])
except Exception:
traceback.print_exc()
print("failing silently...")
def downgrade():
op.drop_index("SSHPubKeysPubKey", "SSHPubKeys")

View file

@ -1,23 +0,0 @@
import pytest
from sqlalchemy import inspect
from aurweb.db import get_engine
from aurweb.models.ssh_pub_key import SSHPubKey
@pytest.fixture(autouse=True)
def setup(db_test):
return
def test_sshpubkeys_pubkey_index():
insp = inspect(get_engine())
indexes = insp.get_indexes(SSHPubKey.__tablename__)
found_pk = False
for idx in indexes:
if idx.get("name") == "SSHPubKeysPubKey":
assert idx.get("column_names") == ["PubKey"]
found_pk = True
assert found_pk