def run(self): if len(self.args) > 0: self.parser.error("Invalid argument") # First we check to see if it is current cur = migrations.current_schema() if cur is None: print "Creating database..." migrations.create() elif cur < schema.version: print "Database schema out of date. Please run migrate." elif cur == schema.version: print "Database schema up-to-date." else: print "Database schema is newer than expected. " "Expected <= %d, got %d." % (schema.version, cur)
def run(self): if len(self.args) > 0: self.parser.error("Invalid argument") # First we check to see if it is current cur = migrations.current_schema() if cur is None: print "Creating database..." migrations.create() elif cur < schema.version: print "Database schema out of date. Please run migrate." elif cur == schema.version: print "Database schema up-to-date." else: print "Database schema is newer than expected. "\ "Expected <= %d, got %d." % (schema.version, cur)
def setUp(self): TestCase.setUp(self) self.dbfile = os.path.join(self.tmpdir, "workflow.db") self.dburi = "sqlite:///%s" % self.dbfile app.config.update(SQLALCHEMY_DATABASE_URI=self.dburi) migrations.create()