diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-18 00:49:57 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-18 00:49:57 +0000 |
commit | bd04cffad83848e3edc5cb51c51ca6232270477a (patch) | |
tree | e7833ed87d00a8e0ac546bc950c7e7d90267c235 /lib/sqlalchemy/databases/mysql.py | |
parent | 819837884e279be306a63e7f6640618afc236e6d (diff) | |
download | sqlalchemy-bd04cffad83848e3edc5cb51c51ca6232270477a.tar.gz |
more fixes for [ticket:269], added MSMediumBlob type
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 14e26438f..be704ef2a 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -34,7 +34,7 @@ class MSDecimal(MSNumeric): def get_col_spec(self): if self.precision is not None and self.length is not None: return kw_colspec(self, "DECIMAL(%(precision)s, %(length)s)" % {'precision': self.precision, 'length' : self.length}) -class MSDouble(sqltypes.Numeric): +class MSDouble(MSNumeric): def __init__(self, precision=10, length=2, **kw): if (precision is None and length is not None) or (precision is not None and length is None): raise exceptions.ArgumentError("You must specify both precision and length or omit both altogether.") @@ -60,28 +60,28 @@ class MSFloat(sqltypes.Float): return kw_colspec(self, "FLOAT(%(precision)s)" % {'precision': self.precision}) else: return kw_colspec(self, "FLOAT") -class MSBigInteger(sqltypes.Integer): +class MSInteger(sqltypes.Integer): def __init__(self, length=None, **kw): self.length = length self.unsigned = 'unsigned' in kw self.zerofill = 'zerofill' in kw - super(MSBigInteger, self).__init__() + super(MSInteger, self).__init__() def get_col_spec(self): if self.length is not None: - return kw_colspec(self, "BIGINT(%(length)s)" % {'length': self.length}) + return kw_colspec(self, "INTEGER(%(length)s)" % {'length': self.length}) else: - return kw_colspec(self, "BIGINT") -class MSInteger(sqltypes.Integer): + return kw_colspec(self, "INTEGER") +class MSBigInteger(MSInteger): def __init__(self, length=None, **kw): self.length = length self.unsigned = 'unsigned' in kw self.zerofill = 'zerofill' in kw - super(MSInteger, self).__init__() + super(MSBigInteger, self).__init__() def get_col_spec(self): if self.length is not None: - return kw_colspec(self, "INTEGER(%(length)s)" % {'length': self.length}) + return kw_colspec(self, "BIGINT(%(length)s)" % {'length': self.length}) else: - return kw_colspec(self, "INTEGER") + return kw_colspec(self, "BIGINT") class MSSmallInteger(sqltypes.Smallinteger): def __init__(self, length=None, **kw): self.length = length @@ -153,7 +153,12 @@ class MSBinary(sqltypes.Binary): return None else: return buffer(value) -class MSEnum(sqltypes.String): + +class MSMediumBlob(MSBinary): + def get_col_spec(self): + return "MEDIUMBLOB" + +class MSEnum(MSString): def __init__(self, *enums): self.__enums_hidden = enums length = 0 |