From c67c168e53a34af73c0ae6f2a74f09da141741d2 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 6 Aug 2007 17:43:30 +0000 Subject: [PATCH] Working on MySQL, oi. --- lib/galaxy/model/mapping.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index b8b9c43e0c4..6f3f22c5441 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -235,6 +235,14 @@ def init( file_path, url, **kwargs ): create_tables = kwargs.pop( 'create_tables', False ) # Connect dataset to the file path Dataset.file_path = file_path + # MySQL hacking, doesn't support passive defaults for anything but TIMESTAMP + if url.startswith( "mysql" ): + for table in metadata.tables.values(): + if table.columns.has_key( "create_time" ): + table.columns['create_time'].type = TIMESTAMP() + if table.columns.has_key( "update_time" ): + table.columns['update_time'].type = TIMESTAMP() + table.columns['update_time'].type = TIMESTAMP() # Connect the metadata the database. metadata.connect( url, **kwargs ) ## metadata.engine.echo = True