#NEWLINE# def _create_version_table_if_not_exists( self ) : #NEWLINE# #INDENT# sql = ( 'create table if not exists %s ( id int(11) NOT NULL AUTO_INCREMENT, version varchar(20) NOT NULL default "0", label varchar(255), name varchar(255), sql_up LONGTEXT, sql_down LONGTEXT, PRIMARY KEY (id));' % self . __version_table ) #NEWLINE# self . __execute ( sql ) #NEWLINE# db = self . __mysql_connect ( ) #NEWLINE# cursor = db . cursor ( ) #NEWLINE# cursor . execute ( ( 'select count(*) from %s;' % self . __version_table ) ) #NEWLINE# count = cursor . fetchone ( ) [ 0 ] #NEWLINE# cursor . close ( ) #NEWLINE# db . close ( ) #NEWLINE# if ( count == 0 ) : #NEWLINE# #INDENT# sql = ( 'insert into %s (version) values ("0");' % self . __version_table ) #NEWLINE# self . __execute ( sql )