Downgrade to revision
421537
def down(tag, sql, revision):
    
    alembic_command.downgrade(
        config=get_config(),
        revision=revision,
        sql=sql,
        tag=tag
    )
215179
public function downgradeDatabase()
    {
        $pe = Type::getByHandle('page_owner');
        $category = Category::getByHandle('page_type');
        if (is_object($category) && is_object($pe)) {
            $category->deassociateAccessEntityType($pe);
        }
    }
734608
def ver(self, revision):
        """"""

        c = self.clone()

        c.version = self._parse_version(self.version)

        return c
333949
function _stripOldVersionInfo(versionInfo, buildNumber) {
        // Do a simple linear search. Since we are going in reverse-chronological order, we
        // should get through the search quickly.
        var lastIndex = 0;
        var len = versionInfo.length;
        var versionEntry;
        var validBuildEntries;

        while (lastIndex < len) {
            versionEntry = versionInfo[lastIndex];
            if (versionEntry.buildNumber <= buildNumber) {
                break;
            }
            lastIndex++;
        }

        if (lastIndex > 0) {
            // Filter recent update entries based on applicability to current platform
            validBuildEntries = versionInfo.slice(0, lastIndex).filter(_checkBuildApplicability);
        }

        return validBuildEntries;
    }
941455
def do_down(self, arg):
        """"""
        print "running down migration"
        self.manager.run_one(arg, Direction.DOWN)
313366
function (streamInfo, rev) {
    this.set('_revision', rev);
    streamInfo.context = streamInfo.context || '_general';
    this.get('_revisions')[streamInfo.context + '_' + streamInfo.aggregate + '_' + streamInfo.aggregateId] = rev;
  }
553043
def _downgrade_v3(op):
    
    op.create_table(
        '_new_equities',
        sa.Column(
            'sid',
            sa.Integer,
            unique=True,
            nullable=False,
            primary_key=True,
        ),
        sa.Column('symbol', sa.Text),
        sa.Column('company_symbol', sa.Text),
        sa.Column('share_class_symbol', sa.Text),
        sa.Column('fuzzy_symbol', sa.Text),
        sa.Column('asset_name', sa.Text),
        sa.Column('start_date', sa.Integer, default=0, nullable=False),
        sa.Column('end_date', sa.Integer, nullable=False),
        sa.Column('first_traded', sa.Integer, nullable=False),
        sa.Column('auto_close_date', sa.Integer),
        sa.Column('exchange', sa.Text),
    )
    op.execute(
        """
        insert into _new_equities
        select * from equities
        where equities.first_traded is not null
        """,
    )
    op.drop_table('equities')
    op.rename_table('_new_equities', 'equities')
    # we need to make sure the indices have the proper names after the rename
    op.create_index(
        'ix_equities_company_symbol',
        'equities',
        ['company_symbol'],
    )
    op.create_index(
        'ix_equities_fuzzy_symbol',
        'equities',
        ['fuzzy_symbol'],
    )
715878
def downgrade():
    """"""
    ctx = op.get_context()
    insp = Inspector.from_engine(ctx.connection.engine)

    for fk in insp.get_foreign_keys('transaction'):
        if fk['referred_table'] == 'accounts_user':
            op.drop_constraint(
                op.f(fk['name']), 'transaction', type_='foreignkey'
            )

    with op.batch_alter_table('transaction') as batch_op:
        batch_op.drop_index(op.f('ix_transaction_user_id'))
        batch_op.drop_column('user_id')
    op.drop_table('accounts_userrole')
    op.drop_table('accounts_user_session_activity')
    op.drop_table('accounts_user')
    op.drop_table('accounts_role')
1194092
def _generate_version(base_version):
    """"""
    pkg_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

    if not _is_git_repo(pkg_dir) or not _have_git():
        return base_version

    if _is_release(pkg_dir, base_version) and not _is_dirty(pkg_dir):
        return base_version

    return "{base_version}+{short_sha}{dirty}".format(
        base_version=base_version,
        short_sha=_git_revision(pkg_dir).decode("utf-8")[0:6],
        dirty=".mod" if _is_dirty(pkg_dir) else "",
    )
175134
def rollout_undo(self, target_revision=None):
        
        if target_revision is None:
            revision = {}
        else:
            revision = {
                "revision": target_revision
            }

        params = {
            "kind": "DeploymentRollback",
            "apiVersion": self.version,
            "name": self.name,
            "rollbackTo": revision
        }

        kwargs = {
            "version": self.version,
            "namespace": self.namespace,
            "operation": "rollback",
        }
        r = self.api.post(**self.api_kwargs(data=json.dumps(params), **kwargs))
        r.raise_for_status()
        return r.text
1139229
function rollback(newVersion) {
  if (strategy === 'stable') {
    // reset master
    shell.exec('git reset --hard origin/master');
    shell.exec('git checkout develop');
  } else {
    // remove last commit
    shell.exec('git reset --hard HEAD~1');
  }

  // remove local created tag
  shell.exec(`git tag -d v${newVersion}`);
  process.exit(1);
}
1281961
public void downgradeLastInode() {
    Preconditions.checkState(endsInInode());
    Preconditions.checkState(!mEntries.isEmpty());
    Preconditions.checkState(mLockMode == LockMode.WRITE);

    InodeEntry last = (InodeEntry) mEntries.get(mEntries.size() - 1);
    LockResource lock = mInodeLockManager.lockInode(last.getInode(), LockMode.READ);
    last.getLock().close();
    mEntries.set(mEntries.size() - 1, new InodeEntry(lock, last.mInode));
    mLockMode = LockMode.READ;
  }
1337127
def revert(self):
        """"""
        index = self.get_stack_index()
        finfo = self.data[index]
        filename = finfo.filename
        if finfo.editor.document().isModified():
            self.msgbox = QMessageBox(
                    QMessageBox.Warning,
                    self.title,
                    _("All changes to <b>%s</b> will be lost."
                      "<br>Do you want to revert file from disk?"
                      ) % osp.basename(filename),
                    QMessageBox.Yes | QMessageBox.No,
                    self)
            answer = self.msgbox.exec_()
            if answer != QMessageBox.Yes:
                return
        self.reload(index)
251534
def commit(self, rev=None):
        """"""
        if rev is None:
            return self.head.commit
        else:
            return self.rev_parse(text_type(rev) + "^0")
2941
private void queueDownloadedRevision(RevisionInternal rev) {

        if (revisionBodyTransformationBlock != null) {
            // Add 'file' properties to attachments pointing to their bodies:

            for (Map.Entry<String, Map<String, Object>> entry : (
                    (Map<String, Map<String, Object>>) rev.getProperties().get("_attachments")).entrySet()) {
                String name = entry.getKey();
                Map<String, Object> attachment = entry.getValue();
                attachment.remove("file");
                if (attachment.get("follows") != null && attachment.get("data") == null) {
                    String filePath = db.fileForAttachmentDict(attachment).getPath();
                    if (filePath != null)
                        attachment.put("file", filePath);
                }
            }

            RevisionInternal xformed = transformRevision(rev);
            if (xformed == null) {
                Log.v(TAG, "%s: Transformer rejected revision %s", this, rev);
                pendingSequences.removeSequence(rev.getSequence());
                lastSequence = pendingSequences.getCheckpointedValue();
                pauseOrResume();
                return;
            }
            rev = xformed;

            // Clean up afterwards
            Map<String, Map<String, Object>> attachments = (Map<String, Map<String, Object>>) rev.getProperties().get("_attachments");

            for (Map.Entry<String, Map<String, Object>> entry : attachments.entrySet()) {
                Map<String, Object> attachment = entry.getValue();
                attachment.remove("file");
            }
        }

        // NOTE: should not/not necessary to call Body.compact()
        // new RevisionInternal(Map<string, Object>) creates Body instance only
        // with `object`. Serializing object to json causes two unnecessary
        // JSON serializations.

        if (rev.getBody() != null)
            queuedMemorySize.addAndGet(rev.getBody().getSize());

        downloadsToInsert.queueObject(rev);

        // if queue memory size is more than maximum, force flush the queue.
        if (queuedMemorySize.get() > MAX_QUEUE_MEMORY_SIZE) {
            Log.d(TAG, "Flushing queued memory size at: " + queuedMemorySize);
            downloadsToInsert.flushAllAndWait();
        }
    }
722669
def not_downgrade(self, package):
        """"""
        name = split_package(package)[0]
        rep_ver = split_package(package)[1]
        ins_ver = GetFromInstalled(name).version()[1:]
        if not ins_ver:
            ins_ver = "0"
        if LooseVersion(rep_ver) < LooseVersion(ins_ver):
            self.msg.template(78)
            print("| Package {0} don't downgrade, "
                  "setting by user".format(name))
            self.msg.template(78)
            return True
1367081
function(instance, opt){
      var previousVersion = instance._previousDataValues;
      var currentVersion = instance.dataValues;

      // Disallow change of revision
      instance.set(options.revisionAttribute, instance._previousDataValues[options.revisionAttribute]);

      // Get diffs
      var diffs = getDifferences(previousVersion, currentVersion, options.exclude);

      if(diffs && diffs.length > 0){
         instance.set(options.revisionAttribute, (instance.get(options.revisionAttribute) || 0) + 1);
         if(!instance.context){
            instance.context = {};
         }
         instance.context.diffs = diffs;
      }
   }