'Set up the schema of the database. `fields` is a mapping
from field names to `Type`s. Columns are added if necessary.'

def _make_table(self, table, fields):

    with self.transaction() as tx:
        rows = tx.query(('PRAGMA    table_info(%s)' % table))
    current_fields = set([row[1] for row in rows])
    field_names = set(fields.keys())
    if current_fields.issuperset(field_names):
        return
    if (not current_fields):
        columns = []
        for (name, typ) in fields.items():
            columns.append('{0}    {1}'.format(name, typ.sql))
        setup_sql = 'CREATE    TABLE    {0}    ({1});\n'.format(table, ',    '.join(columns))
    else:
        setup_sql = ''
        for (name, typ) in fields.items():
            if (name in current_fields):
                continue
            setup_sql += 'ALTER    TABLE    {0}    ADD    COLUMN    {1}    {2};\n'.format(table, name, typ.sql)
    with self.transaction() as tx:
        tx.script(setup_sql)
