CREATE TABLE dbinfo (key VARCHAR, value VARCHAR);
CREATE TABLE items (rowid INTEGER PRIMARY KEY ASC, uuid VARCHAR, flags INTEGER, type INTEGER, parent_id INTEGER NOT NULL, ordering INTEGER);
CREATE TABLE apps (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR,category_id INTEGER, moddate REAL, bookmark BLOB, custom_path VARCHAR);
CREATE TABLE groups (item_id INTEGER PRIMARY KEY, category_id INTEGER, title VARCHAR);
CREATE TABLE downloading_apps (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR, category_id INTEGER, install_path VARCHAR);
CREATE TABLE categories (rowid INTEGER PRIMARY KEY ASC, uti VARCHAR);
CREATE TABLE app_sources (rowid INTEGER PRIMARY KEY ASC, uuid VARCHAR, flags INTEGER, bookmark BLOB, last_fsevent_id INTEGER, fsevent_uuid VARCHAR);
CREATE TABLE image_cache (item_id INTEGER, uuid VARCHAR, size_big INTEGER, size_mini INTEGER, image_data BLOB, image_data_mini BLOB);
CREATE TABLE custom_icons (app_path VARCHAR PRIMARY KEY, icon_data BLOB, icon_data_mini BLOB);
CREATE TABLE removed_apps (bundle_id VARCHAR PRIMARY KEY, removed_at REAL);
CREATE INDEX items_uuid_index ON items (uuid);
CREATE INDEX items_ordering_index ON items (parent_id,ordering);
CREATE INDEX items_type ON items (type);
CREATE INDEX image_cache_index ON image_cache (item_id);
