Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python scripts run as migrations are preventing newer migrations for model XForm from being applied #2481

Open
kelvin-muchiri opened this issue Sep 20, 2023 · 0 comments
Assignees

Comments

@kelvin-muchiri
Copy link
Contributor

kelvin-muchiri commented Sep 20, 2023

Enhancement

Remove implementations of migrations.RunPython from migration file https://github.com/onaio/onadata/blob/main/onadata/apps/logger/migrations/0001_pre-django-3-upgrade.py.

When new fields are added in the XForm model and the migration 001_pre-django-3-upgrade is run for the first time such as when running tests or running migrations for the first time on a new database, the error column X does not exist is raised.

This is because the scripts run within migrations.RunPython are making the presumption that the new field created in a later migration is present in migration 001_pre-django-3-upgrade

One alternative to solve this is to convert migrations.RunPython implementations into Django management commands

Benefits of implementing enhancement

column X does not exist is not raised when applying newer migrations for model XForm

Suggested implementation plan(Steps to be taken to implement feature)

@KipSigei KipSigei added this to the Ona Data Sprint 18 of 2023 milestone Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants