We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Error in migration execution
To Reproduce Steps to reproduce the behavior:
import peewee import peewee_migrate db = peewee.SqliteDatabase(":memory:", pragmas={"foreign_keys": 1}) class User(peewee.Model): class Meta: database = db class TgAccount(peewee.Model): owner = peewee.ForeignKeyField(User) class Meta: database = db for model in [User, TgAccount]: model.create_table() user = User.create() TgAccount.create(owner=user) migrator = peewee_migrate.Migrator(db) migrator.add_fields( User, name=peewee.CharField(default="John") ) migrator.run()
Expected behavior Migration will be executed
Screenshots
Desktop (please complete the following information):
Additional context I understand this is happening because of foreign_keys=1. If this value is removed, the migration will be completed successfully
Perhaps it should be done so that the library automatically changes foreign_keys to 0 when using SQLiteDatabase?
The text was updated successfully, but these errors were encountered:
I fixed it in my code like this. Probably not the best solution
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Error in migration execution
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Migration will be executed
Screenshots
Desktop (please complete the following information):
Additional context
I understand this is happening because of foreign_keys=1.
If this value is removed, the migration will be completed successfully
Perhaps it should be done so that the library automatically changes foreign_keys to 0 when using SQLiteDatabase?
The text was updated successfully, but these errors were encountered: