given column exactly, not just it's parent
table. [ticket:2064]
+- postgresql
+ - Fixed regression from 0.6 where SMALLINT and
+ BIGINT types would both generate SERIAL
+ on an integer PK column, instead of
+ SMALLINT and BIGSERIAL [ticket:2065]
+
- ext
- Association proxy now has correct behavior for
any(), has(), and contains() when proxying
__visit_name__ = 'small_integer'
+ @property
+ def _type_affinity(self):
+ return SmallInteger
+
class BigInteger(Integer):
"""A type for bigger ``int`` integers.
__visit_name__ = 'big_integer'
+ @property
+ def _type_affinity(self):
+ return BigInteger
+
class Numeric(_DateAffinity, TypeEngine):
"""A type for fixed precision numbers.
: Numeric})
assert_raises(exc.InvalidRequestError, testing.db.execute, stmt)
+ def test_serial_integer(self):
+ for type_, expected in [
+ (Integer, 'SERIAL'),
+ (BigInteger, 'BIGSERIAL'),
+ (SmallInteger, 'SMALLINT'),
+ (postgresql.INTEGER, 'SERIAL'),
+ (postgresql.BIGINT, 'BIGSERIAL'),
+ ]:
+ m = MetaData()
+
+ t = Table('t', m, Column('c', type_, primary_key=True))
+ ddl_compiler = testing.db.dialect.ddl_compiler(testing.db.dialect, schema.CreateTable(t))
+ eq_(
+ ddl_compiler.get_column_specification(t.c.c),
+ "c %s NOT NULL" % expected
+ )
+
class TimezoneTest(TestBase):
"""Test timezone-aware datetimes.