def sync_database_options(from_db, to_db):
    """Generate the SQL statements needed to modify the Database options
       of the target schema (patch), and restore them to their previous
       definition (revert)

    Args:
        from_db: A SchemaObject DatabaseSchema Instance.
        to_db: A SchemaObject DatabaseSchema Instance.

    Returns:
        A tuple (patch, revert) containing the SQL statements
        A tuple of empty strings will be returned if no changes were found
    """
    p = []
    r = []
    for opt in from_db.options:
        if from_db.options[opt] != to_db.options[opt]:
            p.append(from_db.options[opt].create())
            r.append(to_db.options[opt].create())
    if p:
        return ' '.join(p), ' '.join(r)
    else:
        return '', ''
