Beispiel #1
0
 def upgrade(self, api):
     """Upgrade Rally database to the latest state."""
     print("Upgrading...")
     start_revision = db.schema_revision()
     db.schema_upgrade()
     current_revision = db.schema_revision()
     if start_revision != current_revision:
         print("Database schema upgraded successfully "
               "from {start} to {end} revision."
               .format(start=start_revision, end=current_revision))
     else:
         print("Database is already up to date")
Beispiel #2
0
 def upgrade(self, api):
     """Upgrade Rally database to the latest state."""
     print("Upgrading...")
     start_revision = db.schema_revision()
     db.schema_upgrade()
     current_revision = db.schema_revision()
     if start_revision != current_revision:
         print("Database schema upgraded successfully "
               "from {start} to {end} revision.".format(
                   start=start_revision, end=current_revision))
     else:
         print("Database is already up to date")
Beispiel #3
0
def output_migration_result(method_name):
    """Print migration result."""
    print("%s started." % method_name.capitalize())
    start_revision = db.schema_revision()
    yield
    print("%s processed." % method_name.capitalize())
    current_revision = db.schema_revision()
    if start_revision != current_revision:
        print("Database migrated successfully "
              "from {start} to {end} revision.".format(start=start_revision,
                                                       end=current_revision))
    else:
        print("Database is already up to date")
Beispiel #4
0
    def ensure(self, api):
        """Creates Rally database if it doesn't exists."""
        print("Ensuring database exists: ", end="")
        self.show(api, True)

        if not db.schema_revision():
            db.schema_create()
            print("Database created successfully")
        else:
            print("Database already exists, nothing to do")
Beispiel #5
0
 def revision(self):
     """Print current Rally database revision UUID."""
     print(db.schema_revision())
Beispiel #6
0
 def test_schema_revision(self):
     rev = db.schema_revision()
     drev = db.schema_revision(detailed=True)
     self.assertEqual(drev["revision"], rev)
     self.assertEqual(drev["revision"], drev["current_head"])
Beispiel #7
0
 def test_schema_revision(self):
     rev = db.schema_revision()
     drev = db.schema_revision(detailed=True)
     self.assertEqual(drev["revision"], rev)
     self.assertEqual(drev["revision"], drev["current_head"])