def test_schema_specifications():
    # Create database
    db = APSWDatabase(':memory:', autorollback=True, journal_mode='WAL', timeout=3000)

    # Create migration router
    router = Router(migrations_path, DATABASE=db)
    migrator = Migrator(db)

    # Run each migration, and validate the specification
    for name in router.fs_migrations:
        # Execute migration
        router.run_one(name, migrator)

        # Match specification against migration
        assert router.match() == name
def test_schema_specifications():
    # Create database
    db = APSWDatabase(':memory:',
                      autorollback=True,
                      journal_mode='WAL',
                      timeout=3000)

    # Create migration router
    router = Router(migrations_path, DATABASE=db)
    migrator = Migrator(db)

    # Run each migration, and validate the specification
    for name in router.fs_migrations:
        # Execute migration
        router.run_one(name, migrator)

        # Match specification against migration
        assert router.match() == name
 def _build_router():
     return Router(migrations_path, DATABASE=db)
Beispiel #4
0
    def _build_router():
        if not Router:
            return None

        return Router(migrations_path, DATABASE=db)
Beispiel #5
0
# from storaage import *

from peewee_migrate.core import Router


router = Router('migrations', DATABASE='storage')
# create migration

router.create('migration_v2')

router.run('migration_v2')

router.run()