<s> import sqlite3 <EOL> from config import DATA_FOLDER <EOL> def migrate ( database_path ) : <EOL> print "<STR_LIT>" <EOL> conn = sqlite3 . connect ( database_path ) <EOL> conn . text_factory = str <EOL> cursor = conn . cursor ( ) <EOL> cursor . execute ( '''<STR_LIT>''' ) <EOL> mappings = cursor . fetchall ( ) <EOL> for mapping in mappings : <EOL> if DATA_FOLDER in mapping [ <NUM_LIT:1> ] : <EOL> path = mapping [ <NUM_LIT:1> ] [ len ( DATA_FOLDER ) : ] <EOL> cursor . execute ( '''<STR_LIT>''' , ( mapping [ <NUM_LIT:0> ] , path ) ) <EOL> cursor . execute ( '''<STR_LIT>''' ) <EOL> conn . commit ( ) <EOL> conn . close ( ) </s>
