CREATE TABLE addressbookobjects (
    id integer primary key asc,
    contactdata blob,
    uri text,
    addressbookid integer,
    lastmodified integer,
    etag text,
    size integer,
    formattedname text,
    structuredname text
);

CREATE TABLE addressbookchanges (
    id integer primary key asc,
    uri text,
    synctoken integer,
    addressbookid integer,
    operation integer
);

CREATE INDEX addressbookid_synctoken ON addressbookchanges (addressbookid, synctoken);

CREATE TABLE pagetoaddressbookmapping (
    id integer primary key asc,
    page text,
    addressbookid integer
);

CREATE TABLE addressbooks (
    id integer primary key asc,
    principaluri text,
    displayname text,
    uri text,
    synctoken integer,
    description text
);
