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

Issue with historic migrations on SQLite < 3.26 with Django 3.2 #224

Closed
rtibbles opened this issue Jun 19, 2024 — with Slack · 1 comment · Fixed by #225
Closed

Issue with historic migrations on SQLite < 3.26 with Django 3.2 #224

rtibbles opened this issue Jun 19, 2024 — with Slack · 1 comment · Fixed by #225
Assignees

Comments

Copy link
Member

Issue running old migrations under Django 3.2 on SQLite < 3.26

  Applying morango.0003_auto_20170519_0543...Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 189, in invoke
    initialize(**get_initialize_params())
  File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 342, in initialize
    update(version, kolibri.__version__)
  File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 396, in update
    _migrate_databases()
  File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 109, in _migrate_databases
    call_command("migrate", interactive=False, database=database)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 181, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/commands/migrate.py", line 246, in handle
    fake_initial=fake_initial,
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/migrations/operations/fields.py", line 353, in database_forwards
    to_model._meta.get_field(self.new_name),
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/db/backends/sqlite3/schema.py", line 115, in alter_field
    ) % (model._meta.db_table, old_field_name))
django.db.utils.NotSupportedError: Renaming the 'morango_scopedefinition'.'scope_id' column while in a transaction is not supported on SQLite &lt; 3.26 because it would break referential integrity. Try adding `atomic = False` to the Migration class.```


[Slack Message](https://learningequality.slack.com/archives/C42EFMC3E/p1718820202793909?thread_ts=1718820202.793909&cid=C42EFMC3E)

Suggested course of action is to squash the migrations so we can just skip this on new installs.
@pcenov
Copy link
Member

pcenov commented Jun 21, 2024

@rtibbles this is preventing me from testing freely new builds on Windows - is there anything that can be done, or we need this issue sorted out first?

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 a pull request may close this issue.

2 participants