Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(60)  |  Call(60)  |  Derive(0)  |  Import(0)
Registers a migration for package.
Check :ref:`data_migration_chapter` chapter for detailed description.

:param pkg: Package name
:param path: String implying a path or `asset specification`
    (e.g. ``ptah:migrations``). Path to directory with migration scripts.
:param title: Optional human readable title.
:param force: Force execute migration during bootstrap process

.. code-block:: python(more...)

        def register_migration(pkg, path, title='', force=False):
    """Registers a migration for package.
    Check :ref:`data_migration_chapter` chapter for detailed description.

    :param pkg: Package name
    :param path: String implying a path or `asset specification`
        (e.g. ``ptah:migrations``). Path to directory with migration scripts.
    :param title: Optional human readable title.
    :param force: Force execute migration during bootstrap process

    .. code-block:: python

      import ptah

      ptah.register_migration(
          'ptah', 'ptah:migrations', 'Ptah database migration')

    """
    info = config.DirectiveInfo()
    discr = (MIGRATION_ID, pkg)

    intr = config.Introspectable(MIGRATION_ID, discr, pkg, MIGRATION_ID)
    intr['package'] = pkg
    intr['path'] = path
    intr['title'] = title
    intr['force'] = force

    def _complete(cfg, pkg, path):
        cfg.get_cfg_storage(MIGRATION_ID)[pkg] = path

    info.attach(
        config.Action(
            _complete, (pkg, path),
            discriminator=discr, introspectables=(intr,))
        )
        


src/p/t/ptah-0.8.0/ptah/tests/test_migrate.py   ptah(Download)
from pyramid.config import ConfigurationConflictError
 
ptah.register_migration('ptah', 'ptah:tests/migrations')
 
 
    def test_register(self):
        from ptah.migrate import MIGRATION_ID
 
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
    def test_register_conflict(self):
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
    def test_doesnt_exist(self):
        from alembic.util import CommandError
        from ptah.migrate import ScriptDirectory
 
        ptah.register_migration('test', 'ptah:unknown_migrations')

src/p/t/ptah-HEAD/ptah/tests/test_migrate.py   ptah(Download)
from pyramid.config import ConfigurationConflictError
 
ptah.register_migration('ptah', 'ptah:tests/migrations')
 
 
    def test_register(self):
        from ptah.migrate import MIGRATION_ID
 
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
    def test_register_conflict(self):
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
        ptah.register_migration(
            'test', 'ptah.tests:migrations', 'Ptah database migration')
    def test_doesnt_exist(self):
        from alembic.util import CommandError
        from ptah.migrate import ScriptDirectory
 
        ptah.register_migration('test', 'ptah:unknown_migrations')

src/p/t/ptah-0.8.0/ptah/scripts/tests/test_migrate.py   ptah(Download)
    def test_list_migrations(self):
        ptah.register_migration('test', 'test:path', 'Test migration')
 
        self.init_ptah()
 
    def test_upgrade_one(self):
        from ptah.migrate import revision, Version
 
        ptah.register_migration('test1', 'test1:path', 'Test migration',True)
        ptah.register_migration('test2', 'test2:path', 'Test migration',True)
    def test_upgrade_several(self):
        from ptah.migrate import revision, Version
 
        ptah.register_migration('test1', 'test1:path', 'Test migration')
        ptah.register_migration('test2', 'test2:path', 'Test migration')

src/p/t/ptah-HEAD/ptah/scripts/tests/test_migrate.py   ptah(Download)
    def test_list_migrations(self):
        ptah.register_migration('test', 'test:path', 'Test migration')
 
        self.init_ptah()
 
    def test_upgrade_one(self):
        from ptah.migrate import revision, Version
 
        ptah.register_migration('test1', 'test1:path', 'Test migration',True)
        ptah.register_migration('test2', 'test2:path', 'Test migration',True)
    def test_upgrade_several(self):
        from ptah.migrate import revision, Version
 
        ptah.register_migration('test1', 'test1:path', 'Test migration')
        ptah.register_migration('test2', 'test2:path', 'Test migration')