mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
remove unused imports, rectify isort violations
Files got into the branch that violate both PEP-8 guidelines and isorts. This fixes them. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4d1faca447
commit
5ceeb88bee
7 changed files with 12 additions and 21 deletions
|
@ -56,14 +56,14 @@ db_backend = aurweb.config.get("database", "backend")
|
|||
def rebuild_unique_indexes_with_str_cols():
|
||||
for idx_name in indexes:
|
||||
sql = f"""
|
||||
DROP INDEX IF EXISTS {idx_name}
|
||||
DROP INDEX IF EXISTS {idx_name}
|
||||
ON {indexes.get(idx_name)[0]}
|
||||
"""
|
||||
op.execute(sql)
|
||||
sql = f"""
|
||||
CREATE UNIQUE INDEX {idx_name}
|
||||
ON {indexes.get(idx_name)[0]}
|
||||
({indexes.get(idx_name)[1]}, {indexes.get(idx_name)[2]})
|
||||
CREATE UNIQUE INDEX {idx_name}
|
||||
ON {indexes.get(idx_name)[0]}
|
||||
({indexes.get(idx_name)[1]}, {indexes.get(idx_name)[2]})
|
||||
"""
|
||||
op.execute(sql)
|
||||
|
||||
|
@ -77,8 +77,8 @@ def upgrade():
|
|||
def op_execute(table_meta):
|
||||
table, charset, collate = table_meta
|
||||
sql = f"""
|
||||
ALTER TABLE {table}
|
||||
CONVERT TO CHARACTER SET {charset}
|
||||
ALTER TABLE {table}
|
||||
CONVERT TO CHARACTER SET {charset}
|
||||
COLLATE {collate}
|
||||
"""
|
||||
op.execute(sql)
|
||||
|
@ -94,8 +94,8 @@ def downgrade():
|
|||
def op_execute(table_meta):
|
||||
table, charset, collate = table_meta
|
||||
sql = f"""
|
||||
ALTER TABLE {table}
|
||||
CONVERT TO CHARACTER SET {src_charset}
|
||||
ALTER TABLE {table}
|
||||
CONVERT TO CHARACTER SET {src_charset}
|
||||
COLLATE {src_collate}
|
||||
"""
|
||||
op.execute(sql)
|
||||
|
|
|
@ -6,6 +6,7 @@ Create Date: 2020-06-08 10:04:13.898617
|
|||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
from sqlalchemy.engine.reflection import Inspector
|
||||
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
"""initial revision
|
||||
|
||||
Revision ID: f47cad5d6d03
|
||||
Revises:
|
||||
Create Date: 2020-02-23 13:23:32.331396
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f47cad5d6d03'
|
||||
down_revision = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue