Skip to content

Commit 72eec0f

Browse files
committed
Rename django_migrations table to plainmigrations
1 parent b3a759c commit 72eec0f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

plain-models/plain/models/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def all_items_equal(seq):
527527
@click.option(
528528
"--prune",
529529
is_flag=True,
530-
help="Delete nonexistent migrations from the django_migrations table.",
530+
help="Delete nonexistent migrations from the plainmigrations table.",
531531
)
532532
@click.option(
533533
"-v",

plain-models/plain/models/migrations/recorder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Migration(models.Model):
3838
class Meta:
3939
packages = Packages()
4040
package_label = "migrations"
41-
db_table = "django_migrations"
41+
db_table = "plainmigrations"
4242

4343
def __str__(self):
4444
return f"Migration {self.name} for {self.app}"
@@ -54,7 +54,7 @@ def migration_qs(self):
5454
return self.Migration.objects.using(self.connection.alias)
5555

5656
def has_table(self):
57-
"""Return True if the django_migrations table exists."""
57+
"""Return True if the plainmigrations table exists."""
5858
with self.connection.cursor() as cursor:
5959
tables = self.connection.introspection.table_names(cursor)
6060
return self.Migration._meta.db_table in tables
@@ -71,7 +71,7 @@ def ensure_schema(self):
7171
editor.create_model(self.Migration)
7272
except DatabaseError as exc:
7373
raise MigrationSchemaMissing(
74-
"Unable to create the django_migrations table (%s)" % exc
74+
"Unable to create the plainmigrations table (%s)" % exc
7575
)
7676

7777
def applied_migrations(self):
@@ -85,7 +85,7 @@ def applied_migrations(self):
8585
for migration in self.migration_qs
8686
}
8787
else:
88-
# If the django_migrations table doesn't exist, then no migrations
88+
# If the plainmigrations table doesn't exist, then no migrations
8989
# are applied.
9090
return {}
9191

plain-models/plain/models/preflight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def check_database_tables(package_configs, **kwargs):
256256
model_tables = connection.introspection.plain_table_names()
257257

258258
unknown_tables = set(db_tables) - set(model_tables)
259-
unknown_tables.discard("django_migrations") # Know this could be there
259+
unknown_tables.discard("plainmigrations") # Know this could be there
260260
if unknown_tables:
261261
table_names = ", ".join(unknown_tables)
262262
specific_hint = f'echo "DROP TABLE IF EXISTS {unknown_tables.pop()}" | plain models db-shell'

0 commit comments

Comments
 (0)