#NEWLINE# def set_database_version( self , version , name = 'database_version' ) : #NEWLINE# #INDENT# 'Sets the database version in the SYSTEM table.\n\n        :param version: an integer database version.\n        :param name: The name of the entry that contains the database version\n                     in the SYSTEM table. Defaults to `database_version`,\n                     which contains the database version for Trac.\n        ' #NEWLINE# current_database_version = self . get_database_version ( name ) #NEWLINE# if ( current_database_version is False ) : #NEWLINE# #INDENT# self . env . db_transaction ( '\n                    INSERT INTO system (name, value) VALUES (%s, %s)\n                    ' , ( name , version ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . env . db_transaction ( '\n                    UPDATE system SET value=%s WHERE name=%s\n                    ' , ( version , name ) ) #NEWLINE# self . log . info ( 'Upgraded %s from %d to %d' , name , current_database_version , version )