Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Proposed Field API additions
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Manfre  
View profile  
 More options Jun 8 2012, 1:16 pm
From: Michael Manfre <mman...@gmail.com>
Date: Fri, 8 Jun 2012 10:16:36 -0700 (PDT)
Local: Fri, Jun 8 2012 1:16 pm
Subject: Re: Proposed Field API additions

On Thursday, June 7, 2012 4:16:12 PM UTC-4, Alex Ogier wrote:

> This isn't particularly robust. The SQL string generated by a
> particular backend isn't considered part of any API, and might change
> formatting or semantics on minor updates. Some SQL is quite
> complicated and dubiously related to the particular field, such as
> extra INDEX or UNIQUE constraint statements. Certain backends elide
> some arguments, performing constraint checking in the application (the
> sqlite backend for example just drops many constraints). In general,
> you want the migrations to be DB-agnostic, and checking SQL output
> loses this feature.

While the entire raw SQL generated by a field may be too unstable to
inspect, the underlying SQL shouldn't be completely ignored. At the very
least, the datatype needs to be inspected when freezing to detect if the
rug has been pulled out from under the ORM.

A real world use case. Django-mssql uses the datetime datatype for datetime
fields. Several years ago, Microsoft made the recommendation that all new
work should use datetime2. A future version of django-mssql will switch to
using datetime2. It would be great if the proposed migration framework
handled that sort of switch, or at the very least displayed a warning about
the need for manual user intervention.

The same type of problem could be encountered if a database backend becomes
unsupported and users are forced to switch to another backend where the
maintainer follows a different set of "best practices". There are many ways
of storing the same data that are all completely valid. The most likely
problem field will be IPAddressField due to varchar(15) vs. unsigned int.

Regards,
Michael Manfre


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.