diff --git a/bookworm/variableSet.py b/bookworm/variableSet.py index 68dd442..a341f0b 100644 --- a/bookworm/variableSet.py +++ b/bookworm/variableSet.py @@ -659,8 +659,12 @@ def loadMetadata(self): #This creates the main (slow) catalog table db.query("""DROP TABLE IF EXISTS %s """ % self.tableName) createcode = """CREATE TABLE IF NOT EXISTS %s ( - """ %self.tableName + ",\n".join(mysqlfields) + ") ENGINE=MYISAM;" - db.query(createcode) + """ % self.tableName + ",\n".join(mysqlfields) + ") ENGINE=MYISAM;" + try: + db.query(createcode) + except: + print createcode + raise #Never have keys before a LOAD DATA INFILE db.query("ALTER TABLE %s DISABLE KEYS" % self.tableName) print "loading data into %s using LOAD DATA LOCAL INFILE..." % self.tableName @@ -718,6 +722,9 @@ def updateMasterVariableTable(self): we store the create code in the databse; """ for variable in self.variables: + # Make sure the variables know who their parent is + variable.fastAnchor = self.fastAnchor + # Update the referents for everything variable.updateVariableDescriptionTable(); inCatalog = self.uniques()