diff --git a/plain-models/plain/models/cli.py b/plain-models/plain/models/cli.py index a5327339be..0959912584 100644 --- a/plain-models/plain/models/cli.py +++ b/plain-models/plain/models/cli.py @@ -527,7 +527,7 @@ def all_items_equal(seq): @click.option( "--prune", is_flag=True, - help="Delete nonexistent migrations from the django_migrations table.", + help="Delete nonexistent migrations from the plainmigrations table.", ) @click.option( "-v", diff --git a/plain-models/plain/models/migrations/recorder.py b/plain-models/plain/models/migrations/recorder.py index 60701d03d6..a8fe81ea42 100644 --- a/plain-models/plain/models/migrations/recorder.py +++ b/plain-models/plain/models/migrations/recorder.py @@ -38,7 +38,7 @@ class Migration(models.Model): class Meta: packages = Packages() package_label = "migrations" - db_table = "django_migrations" + db_table = "plainmigrations" def __str__(self): return f"Migration {self.name} for {self.app}" @@ -54,7 +54,7 @@ def migration_qs(self): return self.Migration.objects.using(self.connection.alias) def has_table(self): - """Return True if the django_migrations table exists.""" + """Return True if the plainmigrations table exists.""" with self.connection.cursor() as cursor: tables = self.connection.introspection.table_names(cursor) return self.Migration._meta.db_table in tables @@ -71,7 +71,7 @@ def ensure_schema(self): editor.create_model(self.Migration) except DatabaseError as exc: raise MigrationSchemaMissing( - "Unable to create the django_migrations table (%s)" % exc + "Unable to create the plainmigrations table (%s)" % exc ) def applied_migrations(self): @@ -85,7 +85,7 @@ def applied_migrations(self): for migration in self.migration_qs } else: - # If the django_migrations table doesn't exist, then no migrations + # If the plainmigrations table doesn't exist, then no migrations # are applied. return {} diff --git a/plain-models/plain/models/preflight.py b/plain-models/plain/models/preflight.py index 369b0fd1b9..0fc480f2d2 100644 --- a/plain-models/plain/models/preflight.py +++ b/plain-models/plain/models/preflight.py @@ -256,7 +256,7 @@ def check_database_tables(package_configs, **kwargs): model_tables = connection.introspection.plain_table_names() unknown_tables = set(db_tables) - set(model_tables) - unknown_tables.discard("django_migrations") # Know this could be there + unknown_tables.discard("plainmigrations") # Know this could be there if unknown_tables: table_names = ", ".join(unknown_tables) specific_hint = f'echo "DROP TABLE IF EXISTS {unknown_tables.pop()}" | plain models db-shell'