galaxy-dist commit 79baa9583d93: lims:
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User rc # Date 1280417621 14400 # Node ID 79baa9583d9390bb6341d3484aa9f55b8e3808f8 # Parent 8d255150cb3e868974777eee030843d2c3e7ad16 lims: - fixed a migration script bug when moving the sample datasets info from the 'sample' to 'sample_dataset' table --- a/lib/galaxy/model/migrate/versions/0052_sample_dataset_table.py +++ b/lib/galaxy/model/migrate/versions/0052_sample_dataset_table.py @@ -61,19 +61,20 @@ def upgrade(): result = db_session.execute( cmd ) for r in result: sample_id = r[0] - dataset_files = from_json_string(r[1]) - for df in dataset_files: - cmd = "INSERT INTO sample_dataset VALUES (%s, %s, %s, %s, '%s', '%s', '%s', '%s', '%s')" - cmd = cmd % ( nextval('sample_dataset'), - localtimestamp(), - localtimestamp(), - str(sample_id), - df['name'], - df['filepath'], - df['status'], - df['error_msg'].replace('"', '').replace("'", ""), - df['size'] ) - db_session.execute( cmd ) + if r[1]: + dataset_files = from_json_string(r[1]) + for df in dataset_files: + cmd = "INSERT INTO sample_dataset VALUES (%s, %s, %s, %s, '%s', '%s', '%s', '%s', '%s')" + cmd = cmd % ( nextval('sample_dataset'), + localtimestamp(), + localtimestamp(), + str(sample_id), + df['name'], + df['filepath'], + df['status'].replace('"', '').replace("'", ""), + "", + df['size'].replace('"', '').replace("'", "") ) + db_session.execute( cmd ) # Delete the dataset_files column in the Sample table try:
participants (1)
-
commits-noreply@bitbucket.org