function appSchema({ version, tables: tableList, unsafeSql }: AppSchemaSpec): AppSchema {
  if (process.env.NODE_ENV !== 'production') {
    invariant(version > 0, `Schema version must be greater than 0`)
  }
  const tables: TableMap = tableList.reduce<{ [TableName<any>]: TableSchema }>((map, table) => {
    if (process.env.NODE_ENV !== 'production') {
      invariant(typeof table === 'object' && table.name, `Table schema must contain a name`)
    }

    map[table.name] = table
    return map
  }, {})

  return { version, tables, unsafeSql }
}
Creates a database schema object. Pass table definitions created using {@see tableSchema}