def forwards(self, orm):
        using_mysql = db.backend_name == 'mysql'
        db.rename_table('easy_thumbnails_storagenew', 'easy_thumbnails_storage')
        if using_mysql:
            try:
                db.drop_foreign_key('easy_thumbnails_source', 'storage_new_id')
            except __HOLE__:
                e = sys.exc_info()[1]   # Python 2.5 compatable "as e"
                # e.g MyISAM tables don't support foreign key constraints
                print("Could not remove foreign key contraint: %s" % e)
        db.rename_column('easy_thumbnails_source', 'storage_new_id', 'storage_id')
        if using_mysql:
            try:
                db.execute('ALTER TABLE easy_thumbnails_source ADD CONSTRAINT '
                           'sourcestorage_id_fk_to_storage FOREIGN KEY (storage_id) '
                           'REFERENCES easy_thumbnails_storage(id)')
            except Exception:
                e = sys.exc_info()[1]   # Python 2.5 compatable "as e"
                print("Could not add contraint: %s" % e)

        if using_mysql:
            try:
                db.drop_foreign_key('easy_thumbnails_thumbnail', 'storage_new_id')
            except ValueError:
                e = sys.exc_info()[1]   # Python 2.5 compatable "as e"
                # e.g MyISAM tables don't support foreign key constraints
                print("Could not remove foreign key contraint: %s" % e)
        db.rename_column('easy_thumbnails_thumbnail', 'storage_new_id', 'storage_id')
        if using_mysql:
            try:
                db.execute('ALTER TABLE easy_thumbnails_thumbnail ADD CONSTRAINT '
                           'thumbnailstorage_id_fk_to_storage FOREIGN KEY (storage_id) '
                           'REFERENCES easy_thumbnails_storage(id)')
            except Exception:
                e = sys.exc_info()[1]   # Python 2.5 compatable "as e"
                print("Could not add contraint: %s" % e)
dataset/ETHPy150Open SmileyChris/easy-thumbnails/easy_thumbnails/south_migrations/0010_rename_storage.py/Migration.forwards