Weblate cannot update some database schemes when upgrading
There is an issue with the weblate instance upgrade (i don't really know exactly what is the problem because I am unable to see the mysql logs), but it seems weblate cannot update the database schemes.
Steps to reproduce:
- cd /usr/local/share/weblate/
- 'sudo -u weblate python3 ./manage.py makemigrations' to make the file
- 'sudo -u weblate python3 ./manage.py migrate' to apply the changes. Changes look like are applied.
- 'sudo -u weblate python3 ./manage.py migrate' again, to check for new migrations. It says new migrations needed!
- 'sudo -u weblate python3 ./manage.py makemigrations' generates a new file with the same mysql query!!!.
what should happen:
- the second time we run 'sudo -u weblate python3 ./manage.py migrate' it should tell us that there are no migrations needed.
The query is adding some more options to the check table because of new checks available on upgrade.
#3 Updated by groente over 1 year ago
- Assignee changed from groente to emmapeel
well, i don't see any failures, even when running migrate with -v3 --traceback.
what i do see is that the migate command adds an entry to the django_migrations table.
running the thing in strace, i don't even see it trying to make any changes to the database structure. All that is sent to the mysql server is the INSERT into the django_migrations table and a whole lot of SELECT's, but no ALTER or UPDATE or anything else I'd expect from an attempt to make the needed adjustments you mentioned.
i'm afraid i can't help you any further on this one, i'm inclined to think there's something wrong with the internal logic of manage.py.
- Status changed from Rejected to Confirmed
- Assignee deleted (
The migration is about available checks. I expect, that some typo or anything in that list, that is not correct, but somehow the migration checks this incorrectly.
I think it is about the table trans_check.check. But I have no idea what it is about. I checked my test system that is using a sqlite3 db and there I also see just VARCHAR as type.
Maybe about the content itself?
select `check` from trans_check group by `check`; +-------------------+ | check | +-------------------+ | begin_space | | ellipsis | | end_colon | | end_exclamation | | end_semicolon | | end_stop | | escaped_newline | | inconsistent | | multiple_failures | | translated | | xml-tags | +-------------------+ 11 rows in set (0.00 sec)
every check I can find in the list of choices.
- Status changed from Confirmed to Resolved
We had issues when we upgrade to 3.0.1 (#16943), because a lot of created migrations scripts were added under `weblate/*/migration/*py`, that made the update to 3.0.1 impossible. That's why we deleted the non committed files.
This also is in line with what we found, how to do a upgrade. On an upgrade you should not need to run `python3 ./manage.py makemigrations`. Maybe it was needed in earlier Weblate versions, but at least for the 3.X ones, you don't need to run them anymore.
And we also see no failing migration anymore.