- table=Table (tablename, self.meta, autoload=True)
+ metadata = MetaData (bind=self.engine)
+ table=Table (tablename, metadata, autoload=True)
- # this likely means we've just created the db, so it's either a fresh install
- # or we come from a 'very old' depl.
+ # this likely means
+ # (.) we've just created the db, so it's either a fresh install, or
+ # (.) we come from a 'very old' depl.
# in either case, an import is required but there's nothing to clean up
print >> sys.stderr,"%s: make sure to run import"%(DBSchema.header,)
elif self.table_exists ('sfa_db_version'):
# in either case, an import is required but there's nothing to clean up
print >> sys.stderr,"%s: make sure to run import"%(DBSchema.header,)
elif self.table_exists ('sfa_db_version'):
after="%s"%self.current_version()
if before != after:
logger.info("DBSchema : upgraded version from %s to %s"%(before,after))
after="%s"%self.current_version()
if before != after:
logger.info("DBSchema : upgraded version from %s to %s"%(before,after))
# this trashes the db altogether, from the current model in sfa.storage.model
# I hope this won't collide with ongoing migrations and all
# this trashes the db altogether, from the current model in sfa.storage.model
# I hope this won't collide with ongoing migrations and all
- migrate.drop_version_control (self.url, self.repository)
+ try:
+ migrate.drop_version_control (self.url, self.repository)
+ except migrate.exceptions.DatabaseNotControlledError:
+ logger.log_exc("Failed to drop version control")