Skip to content

Remove migrações excedentes de article e editorialboard#1360

Merged
robertatakenaka merged 1 commit intoscieloorg:mainfrom
robertatakenaka:corrige_migracoes
Feb 25, 2026
Merged

Remove migrações excedentes de article e editorialboard#1360
robertatakenaka merged 1 commit intoscieloorg:mainfrom
robertatakenaka:corrige_migracoes

Conversation

@robertatakenaka
Copy link
Member

O que esse PR faz?

Corrige o problema a seguir causado por migrações excedentes.

/usr/local/lib/python3.11/site-packages/django/db/backends/utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported.
2026-02-25T13:04:58.702213662Z   warnings.warn(self.APPS_NOT_READY_WARNING_MSG, category=RuntimeWarning)
Traceback (most recent call last):
2026-02-25T13:05:00.844015356Z   File "/app/manage.py", line 31, in <module>
    execute_from_command_line(sys.argv)
2026-02-25T13:05:00.845262342Z   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
2026-02-25T13:05:00.866995993Z     utility.execute()
2026-02-25T13:05:00.867068273Z   File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
2026-02-25T13:05:00.867091073Z     django.setup()
2026-02-25T13:05:00.867121653Z   File "/usr/local/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
2026-02-25T13:05:00.867149145Z   File "/usr/local/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate
    app_config.ready()
  File "/usr/local/lib/python3.11/site-packages/django_prometheus/apps.py", line 24, in ready
    ExportMigrations()
  File "/usr/local/lib/python3.11/site-packages/django_prometheus/migrations.py", line 49, in ExportMigrations
2026-02-25T13:05:00.867230346Z     executor = MigrationExecutor(connections[alias])
2026-02-25T13:05:00.867246743Z                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 18, in __init__
2026-02-25T13:05:00.867279549Z     self.loader = MigrationLoader(self.connection)
2026-02-25T13:05:00.867292353Z                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/loader.py", line 58, in __init__
2026-02-25T13:05:00.867317483Z     self.build_graph()
2026-02-25T13:05:00.867329774Z   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/loader.py", line 276, in build_graph
    self.graph.validate_consistency()
2026-02-25T13:05:00.867355575Z   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/graph.py", line 198, in validate_consistency
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
2026-02-25T13:05:00.867380964Z   File "/usr/local/lib/python3.11/site-packages/django/db/migrations/graph.py", line 198, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
     ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/graph.py", line 60, in raise_error
    raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration editorialboard.0012_change_country_to_foreignkey dependencies reference nonexistent parent node ('editorialboard', '0011_add_manual_input_fields')

Copilot AI review requested due to automatic review settings February 25, 2026 13:27
@robertatakenaka robertatakenaka merged commit 6d92ee6 into scieloorg:main Feb 25, 2026
2 of 6 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes two problematic migration files that were causing Django migration graph validation errors due to non-existent parent dependencies. The removed migrations were duplicate/excess files that conflicted with existing migrations that already implemented the necessary schema changes.

Changes:

  • Removed editorialboard/migrations/0012_change_country_to_foreignkey.py which referenced non-existent parent migration 0011_add_manual_input_fields
  • Removed article/migrations/0046_articleaffiliation.py which was a duplicate attempting to create the ArticleAffiliation model

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
editorialboard/migrations/0012_change_country_to_foreignkey.py Removed obsolete migration that tried to change manual_institution_country from CharField to ForeignKey, but the field is already correctly defined as ForeignKey in the existing migration 0011
article/migrations/0046_articleaffiliation.py Removed duplicate migration that attempted to create ArticleAffiliation model, which is already created in the actual 0046 migration file (0046_contribcollab_contribperson_remove_article_collab_and_more.py)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants