Regression in 0.7b

Issue #2099 resolved
Former user created an issue

It appears that there is a regression in 0.7b (at least 0.7b3), insofar that sqlalchemy.types.Integer no longer accepts a keyword argument "unsigned".

I gather this may only make sense for certain underlying databases (I use MySQL), but in the past I have always been able to use code which specifies:

class MyClass(Base): id = Column(Integer, primary_key=True) value = Column(Integer(unsigned=True))

This is no longer the case.

Comments (2)

  1. Mike Bayer repo owner

    its been reverted to a deprecation in 39c465ecf3f45bbebb37c5d5ed7e1a0fccf5641c.

    Note that using "unsigned=True" with the base Integer type has no effect. sqlalchemy.types.Integer has only a default, do-nothing constructor on the base AbstractType class which discards those values. The ignored arguments were removed and are now back with a warning.

    Here is an example of the difference. This is against 0.6:

    from sqlalchemy import *
    from sqlalchemy.schema import CreateTable
    from sqlalchemy.dialects.mysql import INTEGER
    
    t1 = Table('t1', MetaData(), Column('x', Integer(unsigned=True)))
    
    t2 = Table('t2', MetaData(), Column('x', INTEGER(unsigned=True)))
    
    e = create_engine('mysql://')
    
    print CreateTable(t1).compile(dialect=e.dialect)
    print CreateTable(t2).compile(dialect=e.dialect)
    

    output:

    CREATE TABLE t1 (
        x INTEGER
    )
    
    
    
    CREATE TABLE t2 (
        x INTEGER UNSIGNED
    )
    
  2. Log in to comment