Пример #1
0
def test_workflows(cluster):
    primary_dsn = create_temporary_database('primary')
    replica_dsn = create_temporary_database('replica')

    replication_set = ReplicationSetConfiguration()
    replication_set.database.dsn = primary_dsn
    replication_set.tables.add(
        name='auth_user',
        primary_keys=['id'],
    )

    with cluster:
        create_set(cluster, 'example', replication_set)

        replication_set.database.dsn = replica_dsn
        replication_set.tables.add(name='accounts_userprofile',
                                   primary_keys=['id'],
                                   columns=['id', 'user_id', 'display_name'])
        update_set(cluster, 'example', replication_set)

        upgrade_cluster(cluster, force=True)

        del replication_set.tables[0]
        update_set(cluster, 'example', replication_set)

        drop_set(cluster, 'example')
Пример #2
0
def test_workflows(cluster):
    primary_dsn = create_temporary_database('primary')
    replica_dsn = create_temporary_database('replica')

    replication_set = ReplicationSetConfiguration()
    replication_set.database.dsn = primary_dsn
    replication_set.tables.add(
        name='auth_user',
        primary_keys=['id'],
    )

    with cluster:
        create_set(cluster, 'example', replication_set)

        replication_set.database.dsn = replica_dsn
        replication_set.tables.add(
            name='accounts_userprofile',
            primary_keys=['id'],
            columns=['id', 'user_id', 'display_name']
        )
        update_set(cluster, 'example', replication_set)

        upgrade_cluster(cluster, force=True)

        del replication_set.tables[0]
        update_set(cluster, 'example', replication_set)

        drop_set(cluster, 'example')
Пример #3
0
def drop(cluster, name):
    # TODO: Support forced removal again.
    with cluster:
        return administration.drop_set(cluster, name)
Пример #4
0
def drop(cluster, name):
    # TODO: Support forced removal again.
    with cluster:
        return administration.drop_set(cluster, name)