Ejemplo n.º 1
0
    def rename(self, name, connection=None, **kwargs):
        """Rename this table.

        :param name: New name of the table.
        :type name: string
        :param connection: reuse connection istead of creating new one.
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
        """
        engine = self.bind
        self.new_name = name
        visitorcallable = get_engine_visitor(engine, 'schemachanger')
        run_single_visitor(engine, visitorcallable, self, connection, **kwargs)

        # Fix metadata registration
        self.name = name
        self.deregister()
        self._set_parent(self.metadata)
Ejemplo n.º 2
0
    def rename(self, name, connection=None, **kwargs):
        """Rename this table.

        :param name: New name of the table.
        :type name: string
        :param connection: reuse connection istead of creating new one.
        :type connection: :class:`sqlalchemy.engine.base.Connection` instance
        """
        engine = self.bind
        self.new_name = name
        visitorcallable = get_engine_visitor(engine, 'schemachanger')
        run_single_visitor(engine, visitorcallable, self, connection, **kwargs)

        # Fix metadata registration
        self.name = name
        self.deregister()
        self._set_parent(self.metadata)
Ejemplo n.º 3
0
 def __do_imports(self, visitor_name, *a, **kw):
     engine = kw.pop('engine', self.table.bind)
     from rhodecode.lib.dbmigrate.migrate.changeset.databases.visitor import (
         get_engine_visitor, run_single_visitor)
     visitorcallable = get_engine_visitor(engine, visitor_name)
     run_single_visitor(engine, visitorcallable, self, *a, **kw)
Ejemplo n.º 4
0
 def __do_imports(self, visitor_name, *a, **kw):
     engine = kw.pop('engine', self.table.bind)
     from rhodecode.lib.dbmigrate.migrate.changeset.databases.visitor import (get_engine_visitor,
                                                                              run_single_visitor)
     visitorcallable = get_engine_visitor(engine, visitor_name)
     run_single_visitor(engine, visitorcallable, self, *a, **kw)