Firebird - Schema migrations: add or alter field

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Firebird - Schema migrations: add or alter field

maxi-2
Hi folks,

I'm here again trying to up to date the django-firebird backend.
The last stable version was for django 1.8 LTS, that came to end of life, so I want to update to 1.11 LTS first  and then to 2.0.

Having said that, one of unresolved things is about  adding a non-nullable field to a populated table, in this case Firebird seems to work differently than others sql engines. 
If I have to update data over a recently added field (actually django does this adding a default value and removing this afterward), I need commit the alter table command first then, populate the new field with the provide default value. [1]
Firebird doesn't allow updates/inserts to use objects created in the same transaction (in this case the column) because DDL is actually only really executed/completed at transaction commit.

Then, What do you think is the best approach to achieve this?
Is necessary to rewrite the context maneger interface of BaseDatabaseSchemaEditor?
Maybe a new hook to run command after the metadata update finish?

Regards.


[1] Here there's a discussion about this
https://groups.yahoo.com/neo/groups/firebird-support/conversations/topics/130739

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/4752f38a-d821-4a17-90a3-bb6d2621cc72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.