CREATE TABLE meta(
       schema_version INTEGER NOT NULL DEFAULT 1
);
CREATE TABLE objects(
       id INTEGER PRIMARY KEY NOT NULL,
       name TEXT NOT NULL UNIQUE,
       type INTEGER NOT NULL
);
CREATE TABLE raw_data(
       id INTEGER NOT NULL,
       raw_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
CREATE TABLE kv_data(
       id INTEGER NOT NULL,
       kv_key BLOB NOT NULL,
       kv_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
CREATE TABLE array_data(
       id INTEGER NOT NULL,
       array_index INTEGER NOT NULL,
       array_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
CREATE TABLE IF NOT EXISTS meta(
       schema_version INTEGER NOT NULL DEFAULT 1
);
CREATE TABLE IF NOT EXISTS objects(
       id INTEGER PRIMARY KEY NOT NULL,
       name TEXT NOT NULL UNIQUE,
       type INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS raw_data(
       id INTEGER NOT NULL,
       raw_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
CREATE TABLE IF NOT EXISTS kv_data(
       id INTEGER NOT NULL,
       kv_key BLOB NOT NULL,
       kv_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
CREATE TABLE IF NOT EXISTS array_data(
       id INTEGER NOT NULL,
       array_index INTEGER NOT NULL,
       array_value BLOB NOT NULL,
       FOREIGN KEY(id) REFERENCES objects(id)
       ON DELETE CASCADE ON UPDATE RESTRICT
);
Add 'IF NOT EXISTS' specifier to schema
Add 'IF NOT EXISTS' specifier to schema
