Opened 6 years ago

Closed 6 years ago

#30444 closed Cleanup/optimization (fixed)

Refactor `BaseDatabaseSchemaEditor.create_model`

Reported by: Rob Golding Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've been working on a project that uses Citus as the database (which is a Postgres database extension). I found it easy to override methods to change most of the behaviour in the BaseDatabaseSchemaEditor class, but the create_model functionality differs in that it directly executes SQL which it generates itself.

I propose extracting this logic into a table_sql method, similar to how column_sql works.

I'm happy to submit a PR for this work if it sounds like a reasonable improvement!

Change History (3)

comment:1 by Simon Charette, 6 years ago

Triage Stage: UnreviewedAccepted

That sounds like a reasonable improvement.

comment:2 by Simon Charette, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Mariusz Felisiak <felisiak.mariusz@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 4043dc69:

Fixed #30444 -- Moved SQL generation for tables to BaseDatabaseSchemaEditor.table_sql().

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