Python alembic.op 模块,reverse() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用alembic.op.reverse()

项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return DropConstraintOp.from_constraint(self.to_constraint())
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_constraint is None:
            raise ValueError(
                "operation is not reversible; "
                "original constraint is not present")
        return AddConstraintOp.from_constraint(self._orig_constraint)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return DropIndexOp.from_index(self.to_index())
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_index is None:
            raise ValueError(
                "operation is not reversible; "
                "original index is not present")
        return CreateIndexOp.from_index(self._orig_index)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return DropTableOp.from_table(self.to_table())
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):

        kw = self.kw.copy()
        kw['existing_type'] = self.existing_type
        kw['existing_nullable'] = self.existing_nullable
        kw['existing_server_default'] = self.existing_server_default
        if self.modify_type is not None:
            kw['modify_type'] = self.modify_type
        if self.modify_nullable is not None:
            kw['modify_nullable'] = self.modify_nullable
        if self.modify_server_default is not False:
            kw['modify_server_default'] = self.modify_server_default

        # TODO: make this a little simpler
        all_keys = set(m.group(1) for m in [
            re.match(r'^(?:existing_|modify_)(.+)$', k)
            for k in kw
        ] if m)

        for k in all_keys:
            if 'modify_%s' % k in kw:
                swap = kw['existing_%s' % k]
                kw['existing_%s' % k] = kw['modify_%s' % k]
                kw['modify_%s' % k] = swap

        return self.__class__(
            self.table_name, self.column_name, schema=self.schema,
            **kw
        )
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return DropColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self.column)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_column is None:
            raise ValueError(
                "operation is not reversible; "
                "original column is not present")

        return AddColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self._orig_column)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return ModifyTableOps(
            self.table_name,
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            )),
            schema=self.schema
        )
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse_into(self, downgrade_ops):
        downgrade_ops.ops[:] = list(reversed(
            [op.reverse() for op in self.ops]
        ))
        return downgrade_ops
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def reverse(self):
        return UpgradeOps(
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            ))
        )
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return DropConstraintOp.from_constraint(self.to_constraint())
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_constraint is None:
            raise ValueError(
                "operation is not reversible; "
                "original constraint is not present")
        return AddConstraintOp.from_constraint(self._orig_constraint)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return DropIndexOp.from_index(self.to_index())
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_index is None:
            raise ValueError(
                "operation is not reversible; "
                "original index is not present")
        return CreateIndexOp.from_index(self._orig_index)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return DropTableOp.from_table(self.to_table())
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):

        kw = self.kw.copy()
        kw['existing_type'] = self.existing_type
        kw['existing_nullable'] = self.existing_nullable
        kw['existing_server_default'] = self.existing_server_default
        if self.modify_type is not None:
            kw['modify_type'] = self.modify_type
        if self.modify_nullable is not None:
            kw['modify_nullable'] = self.modify_nullable
        if self.modify_server_default is not False:
            kw['modify_server_default'] = self.modify_server_default

        # TODO: make this a little simpler
        all_keys = set(m.group(1) for m in [
            re.match(r'^(?:existing_|modify_)(.+)$', k)
            for k in kw
        ] if m)

        for k in all_keys:
            if 'modify_%s' % k in kw:
                swap = kw['existing_%s' % k]
                kw['existing_%s' % k] = kw['modify_%s' % k]
                kw['modify_%s' % k] = swap

        return self.__class__(
            self.table_name, self.column_name, schema=self.schema,
            **kw
        )
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return DropColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self.column)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_column is None:
            raise ValueError(
                "operation is not reversible; "
                "original column is not present")

        return AddColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self._orig_column)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return ModifyTableOps(
            self.table_name,
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            )),
            schema=self.schema
        )
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse_into(self, downgrade_ops):
        downgrade_ops.ops[:] = list(reversed(
            [op.reverse() for op in self.ops]
        ))
        return downgrade_ops
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def reverse(self):
        return UpgradeOps(
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            ))
        )
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return DropConstraintOp.from_constraint(self.to_constraint())
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_constraint is None:
            raise ValueError(
                "operation is not reversible; "
                "original constraint is not present")
        return AddConstraintOp.from_constraint(self._orig_constraint)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return DropIndexOp.from_index(self.to_index())
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_index is None:
            raise ValueError(
                "operation is not reversible; "
                "original index is not present")
        return CreateIndexOp.from_index(self._orig_index)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return DropTableOp.from_table(self.to_table())
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):

        kw = self.kw.copy()
        kw['existing_type'] = self.existing_type
        kw['existing_nullable'] = self.existing_nullable
        kw['existing_server_default'] = self.existing_server_default
        if self.modify_type is not None:
            kw['modify_type'] = self.modify_type
        if self.modify_nullable is not None:
            kw['modify_nullable'] = self.modify_nullable
        if self.modify_server_default is not False:
            kw['modify_server_default'] = self.modify_server_default

        # TODO: make this a little simpler
        all_keys = set(m.group(1) for m in [
            re.match(r'^(?:existing_|modify_)(.+)$', k)
            for k in kw
        ] if m)

        for k in all_keys:
            if 'modify_%s' % k in kw:
                swap = kw['existing_%s' % k]
                kw['existing_%s' % k] = kw['modify_%s' % k]
                kw['modify_%s' % k] = swap

        return self.__class__(
            self.table_name, self.column_name, schema=self.schema,
            **kw
        )
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return DropColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self.column)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_column is None:
            raise ValueError(
                "operation is not reversible; "
                "original column is not present")

        return AddColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self._orig_column)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return ModifyTableOps(
            self.table_name,
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            )),
            schema=self.schema
        )
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse_into(self, downgrade_ops):
        downgrade_ops.ops[:] = list(reversed(
            [op.reverse() for op in self.ops]
        ))
        return downgrade_ops
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def reverse(self):
        return UpgradeOps(
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            ))
        )
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return DropConstraintOp.from_constraint(self.to_constraint())
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_constraint is None:
            raise ValueError(
                "operation is not reversible; "
                "original constraint is not present")
        return AddConstraintOp.from_constraint(self._orig_constraint)
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return DropIndexOp.from_index(self.to_index())
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_index is None:
            raise ValueError(
                "operation is not reversible; "
                "original index is not present")
        return CreateIndexOp.from_index(self._orig_index)
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return DropTableOp.from_table(self.to_table())
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):

        kw = self.kw.copy()
        kw['existing_type'] = self.existing_type
        kw['existing_nullable'] = self.existing_nullable
        kw['existing_server_default'] = self.existing_server_default
        if self.modify_type is not None:
            kw['modify_type'] = self.modify_type
        if self.modify_nullable is not None:
            kw['modify_nullable'] = self.modify_nullable
        if self.modify_server_default is not False:
            kw['modify_server_default'] = self.modify_server_default

        # TODO: make this a little simpler
        all_keys = set(m.group(1) for m in [
            re.match(r'^(?:existing_|modify_)(.+)$', k)
            for k in kw
        ] if m)

        for k in all_keys:
            if 'modify_%s' % k in kw:
                swap = kw['existing_%s' % k]
                kw['existing_%s' % k] = kw['modify_%s' % k]
                kw['modify_%s' % k] = swap

        return self.__class__(
            self.table_name, self.column_name, schema=self.schema,
            **kw
        )
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return DropColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self.column)
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_column is None:
            raise ValueError(
                "operation is not reversible; "
                "original column is not present")

        return AddColumnOp.from_column_and_tablename(
            self.schema, self.table_name, self._orig_column)
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return ModifyTableOps(
            self.table_name,
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            )),
            schema=self.schema
        )
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse_into(self, downgrade_ops):
        downgrade_ops.ops[:] = list(reversed(
            [op.reverse() for op in self.ops]
        ))
        return downgrade_ops
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def reverse(self):
        return UpgradeOps(
            ops=list(reversed(
                [op.reverse() for op in self.ops]
            ))
        )
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):
        return DropConstraintOp.from_constraint(self.to_constraint())
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_constraint is None:
            raise ValueError(
                "operation is not reversible; "
                "original constraint is not present")
        return AddConstraintOp.from_constraint(self._orig_constraint)
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):
        return DropIndexOp.from_index(self.to_index())
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):
        if self._orig_index is None:
            raise ValueError(
                "operation is not reversible; "
                "original index is not present")
        return CreateIndexOp.from_index(self._orig_index)
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):
        return DropTableOp.from_table(self.to_table())
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def reverse(self):

        kw = self.kw.copy()
        kw['existing_type'] = self.existing_type
        kw['existing_nullable'] = self.existing_nullable
        kw['existing_server_default'] = self.existing_server_default
        if self.modify_type is not None:
            kw['modify_type'] = self.modify_type
        if self.modify_nullable is not None:
            kw['modify_nullable'] = self.modify_nullable
        if self.modify_server_default is not False:
            kw['modify_server_default'] = self.modify_server_default

        # TODO: make this a little simpler
        all_keys = set(m.group(1) for m in [
            re.match(r'^(?:existing_|modify_)(.+)$', k)
            for k in kw
        ] if m)

        for k in all_keys:
            if 'modify_%s' % k in kw:
                swap = kw['existing_%s' % k]
                kw['existing_%s' % k] = kw['modify_%s' % k]
                kw['modify_%s' % k] = swap

        return self.__class__(
            self.table_name, self.column_name, schema=self.schema,
            **kw
        )