Changes between Initial Version and Version 1 of Ticket #26399
- Timestamp:
- Mar 23, 2016, 10:44:01 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26399
- Property Triage Stage Unreviewed → Accepted
- Property Summary Migration refactoring - to facilitate third-party backend integration → Refactor SchemaEditor to facilitate Firebird handlings of column defaults
- Property Type Uncategorized → Cleanup/optimization
-
Ticket #26399 – Description
initial v1 1 1 I humbly think that django migration api need a some refactoring to facilitate third-party backend integration. 2 2 3 For instance, add_field method ![1], if I try to delete a default value on a column that does not have a previous default value definition I get an error on firebird, for which reason, I need to check if that field has got defined a default value before. Then I need to rewrite the whole add_field method too.3 For instance, the [https://github.com/django/django/blob/14e6823d090a077d27f9f7caff2d505db31e55a7/django/db/backends/base/schema.py#L373 SchemaEditor.add_field()] method, if I try to delete a default value on a column that does not have a previous default value definition I get an error on firebird, for which reason, I need to check if that field has got defined a default value before. Then I need to rewrite the whole add_field method too. 4 4 5 Maybe a possible approach would be to have sql templates ( sql_alter_column_default, sql_alter_column_no_default, etc) as methods, instead of class attributes.5 Maybe a possible approach would be to have sql templates (`sql_alter_column_default`, `sql_alter_column_no_default`, etc.) as methods, instead of class attributes. 6 6 7 A disscusion about this en google groups 8 https://groups.google.com/forum/#!topicsearchin/django-developers/migrations$20firebird/django-developers/yZ0IWGT2qZQ 9 10 ![1] https://github.com/django/django/blob/master/django/db/backends/base/schema.py#L373 7 [https://groups.google.com/d/topic/django-developers/yZ0IWGT2qZQ/discussion A discussion about this on django-developers].