Ejemplo n.º 1
0
 def _migrate_down(self, engine, version):
     migration_api.downgrade(engine,
                             TestMigrations.REPOSITORY,
                             version)
     self.assertEqual(version,
                      migration_api.db_version(engine,
                                               TestMigrations.REPOSITORY))
Ejemplo n.º 2
0
    def _migrate_down(self, engine, version, with_data=False):
        migration_api.downgrade(engine, TestMigrations.REPOSITORY, version)
        self.assertEqual(
            version, migration_api.db_version(engine,
                                              TestMigrations.REPOSITORY))

        # NOTE(sirp): `version` is what we're downgrading to (i.e. the 'target'
        # version). So if we have any downgrade checks, they need to be run for
        # the previous (higher numbered) migration.
        if with_data:
            post_downgrade = getattr(self,
                                     "_post_downgrade_%03d" % (version + 1),
                                     None)
            if post_downgrade:
                post_downgrade(engine)
Ejemplo n.º 3
0
    def _migrate_down(self, engine, version, with_data=False):
        migration_api.downgrade(engine,
                                TestMigrations.REPOSITORY,
                                version)
        self.assertEqual(version,
                         migration_api.db_version(engine,
                                                  TestMigrations.REPOSITORY))

        # NOTE(sirp): `version` is what we're downgrading to (i.e. the 'target'
        # version). So if we have any downgrade checks, they need to be run for
        # the previous (higher numbered) migration.
        if with_data:
            post_downgrade = getattr(self, "_post_downgrade_%03d" %
                                           (version + 1), None)
            if post_downgrade:
                post_downgrade(engine)
Ejemplo n.º 4
0
 def _migrate_down(self, engine, version):
     migration_api.downgrade(engine, TestMigrations.REPOSITORY, version)
     self.assertEqual(
         version, migration_api.db_version(engine,
                                           TestMigrations.REPOSITORY))