Esempio n. 1
0
 def downgrade(self, version):
     try:
         #version for migrate should be valid int - else skip
         if version in ('base', None):
             version = self.init_version
         version = int(version)
         return migration.db_sync(self.repository,
                                  version,
                                  init_version=self.init_version)
     except ValueError:
         LOG.error(
             _('Migration number for migrate plugin must be valid '
               'integer or empty, if you want to downgrade '
               'to initial state'))
         raise
Esempio n. 2
0
 def downgrade(self, version):
     try:
         #version for migrate should be valid int - else skip
         if version in ('base', None):
             version = self.init_version
         version = int(version)
         return migration.db_sync(
             self.repository, version,
             init_version=self.init_version)
     except ValueError:
         LOG.error(
             _('Migration number for migrate plugin must be valid '
               'integer or empty, if you want to downgrade '
               'to initial state')
         )
         raise
Esempio n. 3
0
 def upgrade(self, version):
     version = None if version == 'head' else version
     return migration.db_sync(self.repository,
                              version,
                              init_version=self.init_version)
Esempio n. 4
0
 def upgrade(self, version):
     version = None if version == 'head' else version
     return migration.db_sync(
         self.repository, version,
         init_version=self.init_version)