summaryrefslogtreecommitdiff
path: root/django/db/backends/sqlite3/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/sqlite3/schema.py')
-rw-r--r--django/db/backends/sqlite3/schema.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py
index 10edfd81b9..ac6ae5efbd 100644
--- a/django/db/backends/sqlite3/schema.py
+++ b/django/db/backends/sqlite3/schema.py
@@ -206,9 +206,9 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Construct a new model with the new fields to allow self referential
# primary key to resolve to. This model won't ever be materialized as a
- # table and solely exists for foreign key reference resolution purposes.
- # This wouldn't be required if the schema editor was operating on model
- # states instead of rendered models.
+ # table and solely exists for foreign key reference resolution
+ # purposes. This wouldn't be required if the schema editor was
+ # operating on model states instead of rendered models.
meta_contents = {
"app_label": model._meta.app_label,
"db_table": model._meta.db_table,
@@ -303,10 +303,10 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
if field.many_to_many and field.remote_field.through._meta.auto_created:
self.create_model(field.remote_field.through)
elif isinstance(field, CompositePrimaryKey):
- # If a CompositePrimaryKey field was added, the existing primary key field
- # had to be altered too, resulting in an AddField, AlterField migration.
- # The table cannot be re-created on AddField, it would result in a
- # duplicate primary key error.
+ # If a CompositePrimaryKey field was added, the existing primary
+ # key field had to be altered too, resulting in an AddField,
+ # AlterField migration. The table cannot be re-created on AddField,
+ # it would result in a duplicate primary key error.
return
elif (
# Primary keys and unique fields are not supported in ALTER TABLE
@@ -404,7 +404,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
related_models.add(remote_field.through)
if new_field.primary_key:
for many_to_many in opts.many_to_many:
- # Ignore self-relationship since the table was already rebuilt.
+ # Ignore self-relationship since the table was already
+ # rebuilt.
if many_to_many.related_model == model:
continue
if many_to_many.remote_field.through._meta.auto_created: