sqlite alter table messes foreign keys
Bug #1552351 reported by
Pierre Tardy
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sqlalchemy-migrate |
New
|
Undecided
|
Unassigned |
Bug Description
I am trying to enable sqlite3 fk support in buildbot.
on my system, following command:
ALTER TABLE %s RENAME TO migration_tmp
will also rename foreign key contraints from *other* tables to migration_tmp
If I change the code to:
+ self.append('pragma foreign_keys=OFF')
+ self.execute()
+ self.append('pragma foreign_keys=ON')
+ self.execute()
then the constraints are not renamed, and the migration script can work
I am not sure exactly how to make this work apart from disabling foreign keys when doing migrations.
To post a comment you must log in.
FYI, this is the context code. /github. com/buildbot/ buildbot/ pull/2024
https:/