diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-05-14 19:49:40 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-05-14 19:49:40 +0000 |
commit | 65f4f02ec8de1459f852412766b5f469b15839b6 (patch) | |
tree | 20b6b281ce47a22a2cd7749ddf3775c27051f511 /lib/sqlalchemy/databases/mysql.py | |
parent | a52a8dd8768509589d7a3310778e104a4a318a33 (diff) | |
download | sqlalchemy-65f4f02ec8de1459f852412766b5f469b15839b6.tar.gz |
Columns now have default= and server_default=. PassiveDefault fades away.
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 0f40569b1..c4e6bf31f 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -671,19 +671,18 @@ class MSTimeStamp(sqltypes.TIMESTAMP): """MySQL TIMESTAMP type. To signal the orm to automatically re-select modified rows to retrieve - the updated timestamp, add a PassiveDefault to your column specification:: + the updated timestamp, add a DefaultClause to your column specification:: from sqlalchemy.databases import mysql Column('updated', mysql.MSTimeStamp, - PassiveDefault(sql.text('CURRENT_TIMESTAMP'))) + server_default=sql.text('CURRENT_TIMESTAMP')) The full range of MySQL 4.1+ TIMESTAMP defaults can be specified in - the PassiveDefault:: + the the default: - PassiveDefault(sql.text('CURRENT TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) + server_default=sql.text('CURRENT TIMESTAMP ON UPDATE CURRENT_TIMESTAMP') """ - def get_col_spec(self): return "TIMESTAMP" @@ -2228,7 +2227,7 @@ class MySQLSchemaReflector(object): default = sql.text(default) else: default = default[1:-1] - col_args.append(schema.PassiveDefault(default)) + col_args.append(schema.DefaultClause(default)) table.append_column(schema.Column(name, type_instance, *col_args, **col_kw)) |