Skip to content

Commit

Permalink
reformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Mar 12, 2024
1 parent 1494985 commit 373faf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 9 additions & 9 deletions piccolo/apps/migrations/auto/migration_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ async def _run_rename_columns(self, backwards: bool = False):
async def _run_add_tables(self, backwards: bool = False):
table_classes: t.List[t.Type[Table]] = []
for add_table in self.add_tables:
add_columns: t.List[AddColumnClass] = (
self.add_columns.for_table_class_name(add_table.class_name)
)
add_columns: t.List[
AddColumnClass
] = self.add_columns.for_table_class_name(add_table.class_name)
_Table: t.Type[Table] = create_table_class(
class_name=add_table.class_name,
class_kwargs={
Expand Down Expand Up @@ -792,9 +792,9 @@ async def _run_add_columns(self, backwards: bool = False):
if table_class_name in [i.class_name for i in self.add_tables]:
continue # No need to add columns to new tables

add_columns: t.List[AddColumnClass] = (
self.add_columns.for_table_class_name(table_class_name)
)
add_columns: t.List[
AddColumnClass
] = self.add_columns.for_table_class_name(table_class_name)

###############################################################
# Define the table, with the columns, so the metaclass
Expand Down Expand Up @@ -838,9 +838,9 @@ async def _run_add_columns(self, backwards: bool = False):
else:
primary_key = existing_table._meta.primary_key

table_class_members[primary_key._meta.name] = (
primary_key
)
table_class_members[
primary_key._meta.name
] = primary_key

break

Expand Down
2 changes: 0 additions & 2 deletions tests/apps/migrations/auto/integration/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,6 @@ def test_target_column(self):
@engines_only("postgres", "cockroach")
class TestForeignKeySelf(MigrationTestCase):
def setUp(self):

class TableA(Table):
id = UUID(primary_key=True)
table_a = ForeignKey("self")
Expand Down Expand Up @@ -1071,7 +1070,6 @@ def test_create_table(self):

@engines_only("postgres", "cockroach")
class TestAddForeignKeySelf(MigrationTestCase):

def setUp(self):
pass

Expand Down

0 comments on commit 373faf1

Please sign in to comment.