Opened 9 years ago

Last modified 3 years ago

#26399 closed Cleanup/optimization

Refactor SchemaEditor to facilitate Firebird handlings of column defaults — at Version 1

Reported by: Maximiliano Robaina Owned by: nobody
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I humbly think that django migration api need a some refactoring to facilitate third-party backend integration.

For instance, the 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.

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.

A discussion about this on django-developers.

Change History (1)

comment:1 by Tim Graham, 9 years ago

Description: modified (diff)
Summary: Migration refactoring - to facilitate third-party backend integrationRefactor SchemaEditor to facilitate Firebird handlings of column defaults
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

It will be easiest to move forward with this if you can submit a pull request with a proposal.

Note: See TracTickets for help on using tickets.
Back to Top