[hg] galaxy 2785: Fix migration script naming collision.
details: http://www.bx.psu.edu/hg/galaxy/rev/d8e3ad46bfa3 changeset: 2785:d8e3ad46bfa3 user: jeremy goecks <jeremy.goecks@emory.edu> date: Fri Sep 25 17:21:26 2009 -0400 description: Fix migration script naming collision. 2 file(s) affected in this change: lib/galaxy/model/migrate/versions/0020_user_prefs.py lib/galaxy/model/migrate/versions/0021_user_prefs.py diffs (100 lines): diff -r 6f8b5f1e8ec9 -r d8e3ad46bfa3 lib/galaxy/model/migrate/versions/0020_user_prefs.py --- a/lib/galaxy/model/migrate/versions/0020_user_prefs.py Fri Sep 25 17:07:13 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -""" -This migration script adds a user preferences table to Galaxy. -""" - -from sqlalchemy import * -from migrate import * - -import datetime -now = datetime.datetime.utcnow - -import logging -log = logging.getLogger( __name__ ) - -metadata = MetaData( migrate_engine ) - -def display_migration_details(): - print "" - print "This migration script adds a user preferences table to Galaxy." - print "" - - -# New table to support user preferences. - -UserPreference_table = Table( "user_preference", metadata, - Column( "id", Integer, primary_key=True ), - Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True ), - Column( "name", Unicode( 255 ), index=True), - Column( "value", Unicode( 1024 ) ) ) - -def upgrade(): - display_migration_details() - metadata.reflect() - try: - UserPreference_table.create() - except Exception, e: - print str(e) - log.debug( "Creating user_preference table failed: %s" % str( e ) ) - -def downgrade(): - metadata.reflect() - try: - UserPreference_table.drop() - except Exception, e: - print str(e) - log.debug( "Dropping user_preference table failed: %s" % str( e ) ) \ No newline at end of file diff -r 6f8b5f1e8ec9 -r d8e3ad46bfa3 lib/galaxy/model/migrate/versions/0021_user_prefs.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/galaxy/model/migrate/versions/0021_user_prefs.py Fri Sep 25 17:21:26 2009 -0400 @@ -0,0 +1,45 @@ +""" +This migration script adds a user preferences table to Galaxy. +""" + +from sqlalchemy import * +from migrate import * + +import datetime +now = datetime.datetime.utcnow + +import logging +log = logging.getLogger( __name__ ) + +metadata = MetaData( migrate_engine ) + +def display_migration_details(): + print "" + print "This migration script adds a user preferences table to Galaxy." + print "" + + +# New table to support user preferences. + +UserPreference_table = Table( "user_preference", metadata, + Column( "id", Integer, primary_key=True ), + Column( "user_id", Integer, ForeignKey( "galaxy_user.id" ), index=True ), + Column( "name", Unicode( 255 ), index=True), + Column( "value", Unicode( 1024 ) ) ) + +def upgrade(): + display_migration_details() + metadata.reflect() + try: + UserPreference_table.create() + except Exception, e: + print str(e) + log.debug( "Creating user_preference table failed: %s" % str( e ) ) + +def downgrade(): + metadata.reflect() + try: + UserPreference_table.drop() + except Exception, e: + print str(e) + log.debug( "Dropping user_preference table failed: %s" % str( e ) ) \ No newline at end of file
participants (1)
-
Nate Coraor