On Aug 26, 2010, at 12:15 PM, Chris Withers wrote:

> Michael Bayer wrote:
>>> How can it be changed so that the column reflected from the DB and the 
>>> column calculated from the model end up being the same?
>> if schemas are being diffed, types can be compared "generically" using "type 
>> affinity".  This is described at:
>> http://www.sqlalchemy.org/trac/wiki/06Migration#ReflectionReturnsDialect-SpecificTypes
>> You could also take a reflected table and force all of its types down to the 
>> "generic" ones using a hack like column.type.__class__ = 
>> column.type._type_affinity to change the class of each type down to its 
>> "basic" version.     But if a diff is all that's needed they should be using 
>> that.
> 
> Cool, I shall have a look into that, thanks!
> 
>> (FYI alembic will have no schema diff feature its not something I buy into 
>> much)
> 
> Unfortunately, I'm in an environment where people are accident prone / lazy. 
> Numbers in a version table do not imply the schema actually matches the model 
> ;-)

then you have an organizational issue, not a software one.   If you're using 
migrations, people shouldn't be touching the database directly.    Databases 
have great, granular security models to ensure that only one user can actually 
ALTER anything.

> 
> Schema diffing is the only way I can see to "be safe".

DB permissions


> 
> How's Alembic progressing? Some of the stuff in Migrate (like the monkey 
> patching of new bases classes into things like Table and Column) makes my 
> skin crawl, but I didn't see any checkins to Alembic in the last few months...

ive got no time to work on it and no need for it at the moment.   There are two 
major 0.7 features that are higher on my radar as well as some major doc 
rewrites.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to