Exemple #1
0
    def _register_do_nothing_migrations(self, app):
        # Register a do-nothing migration into app
        @migration(app, 1)
        class DoNothingMigration(Migration):

            @classmethod
            def apply(cls, cur, **kwargs):
                cur.execute('SELECT 1 FROM test_migrations')

            @classmethod
            def unapply(cls, cur):
                cur.execute('SELECT 2 FROM test_migrations')

        MigrationManager.add_migration(app, 2, DoNothingMigration)