From f8c9688b41ae3cc3e20ce809a0ebced666530f88 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 4 Aug 2006 06:47:53 +0000 Subject: [PATCH] fixed mysql reflection of default values to be PassiveDefault --- CHANGES | 1 + lib/sqlalchemy/databases/mysql.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index da97fff353..8d49e4d844 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,7 @@ reflection. - adjustments to pool stemming from changes made for [ticket:224]. overflow counter should only be decremented if the connection actually succeeded. added a test script to attempt testing this. +- fixed mysql reflection of default values to be PassiveDefault 0.2.6 - big overhaul to schema to allow truly composite primary and foreign diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index c9ebd7ba63..c98593a55d 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -347,11 +347,13 @@ class MySQLDialect(ansisql.ANSIDialect): else: argslist = re.findall(r'(\d+)', args) coltype = coltype(*[int(a) for a in argslist], **kw) - - table.append_item(schema.Column(name, coltype, + + colargs= [] + if default: + colargs.append(schema.PassiveDefault(sql.text(default))) + table.append_item(schema.Column(name, coltype, *colargs, **dict(primary_key=primary_key, nullable=nullable, - default=default ))) tabletype = self.moretableinfo(connection, table=table) -- 2.47.2