Commit 231aa3de authored by Glandos's avatar Glandos
Browse files

minor fixes and format

parent e6bfabc7
...@@ -288,9 +288,9 @@ class PostgreSQL(Database): ...@@ -288,9 +288,9 @@ class PostgreSQL(Database):
) )
for statement in self.drop_contraint_statements: for statement in self.drop_contraint_statements:
self.cursor.execute(statement) self.cursor.execute(statement)
click.echo(" Done.") click.echo(" Done.")
# Collect indices after dropping constraints
self.indices = self.get_indices() self.indices = self.get_indices()
index_names = self.indices.keys() index_names = self.indices.keys()
click.echo( click.echo(
...@@ -298,15 +298,13 @@ class PostgreSQL(Database): ...@@ -298,15 +298,13 @@ class PostgreSQL(Database):
nl=False, nl=False,
) )
self.cursor.execute(f"DROP INDEX {','.join(index_names)}") self.cursor.execute(f"DROP INDEX {','.join(index_names)}")
click.echo(" Done.") click.echo(" Done.")
def after_import(self): def after_import(self):
with self.connection: with self.connection:
if self.options.get("fast", False): if self.options.get("fast", False):
index_names = self.indices.keys()
click.echo( click.echo(
f"-> Postgresql target, recreating indices: {', '.join(index_names)}…", f"-> Postgresql target, recreating indices: {', '.join(self.indices.keys())}…",
nl=False, nl=False,
) )
for statement in self.indices.values(): for statement in self.indices.values():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment