# migrations

dir: embeddings_queue
filename: 00001-embeddings.sqlite.sql
hash: d3755dfd232be8e8301f4d7fcfb3a486
sql:
CREATE TABLE embeddings_queue (
    seq_id INTEGER PRIMARY KEY,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    operation INTEGER NOT NULL,
    topic TEXT NOT NULL,
    id TEXT NOT NULL,
    vector BLOB,
    encoding TEXT,
    metadata TEXT
);


dir: sysdb
filename: 00001-collections.sqlite.sql
hash: 38352d725ad1c16074fac420b22b4633
sql:
CREATE TABLE collections (
    id TEXT PRIMARY KEY,
    name TEXT NOT NULL,
    topic TEXT NOT NULL,
    UNIQUE (name)
);

CREATE TABLE collection_metadata (
    collection_id TEXT REFERENCES collections(id) ON DELETE CASCADE,
    key TEXT NOT NULL,
    str_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (collection_id, key)
);


dir: sysdb
filename: 00002-segments.sqlite.sql
hash: 2913cb6a503055a95f625448037e8912
sql:
CREATE TABLE segments (
    id TEXT PRIMARY KEY,
    type TEXT NOT NULL,
    scope TEXT NOT NULL,
    topic TEXT,
    collection TEXT REFERENCES collection(id)
);

CREATE TABLE segment_metadata (
    segment_id TEXT  REFERENCES segments(id) ON DELETE CASCADE,
    key TEXT NOT NULL,
    str_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (segment_id, key)
);


dir: sysdb
filename: 00004-tenants-databases.sqlite.sql
hash: 048867ce8fcdefe4023c7110e4433591
sql:
CREATE TABLE IF NOT EXISTS tenants (
    id TEXT PRIMARY KEY,
    UNIQUE (id)
);

CREATE TABLE IF NOT EXISTS databases (
    id TEXT PRIMARY KEY, -- unique globally
    name TEXT NOT NULL, -- unique per tenant
    tenant_id TEXT NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
    UNIQUE (tenant_id, name) -- Ensure that a tenant has only one database with a given name
);

CREATE TABLE IF NOT EXISTS collections_tmp (
    id TEXT PRIMARY KEY, -- unique globally
    name TEXT NOT NULL, -- unique per database
    topic TEXT NOT NULL,
    dimension INTEGER,
    database_id TEXT NOT NULL REFERENCES databases(id) ON DELETE CASCADE,
    UNIQUE (name, database_id)
);

-- Create default tenant and database
INSERT OR REPLACE INTO tenants (id) VALUES ('default_tenant'); -- The default tenant id is 'default_tenant' others are UUIDs
INSERT OR REPLACE INTO databases (id, name, tenant_id) VALUES ('00000000-0000-0000-0000-000000000000', 'default_database', 'default_tenant');

INSERT OR REPLACE INTO collections_tmp (id, name, topic, dimension, database_id)
    SELECT id, name, topic, dimension, '00000000-0000-0000-0000-000000000000' FROM collections;
DROP TABLE collections;
ALTER TABLE collections_tmp RENAME TO collections;


dir: metadb
filename: 00001-embedding-metadata.sqlite.sql
hash: 2b4cf52c4bb2676e21d6860a4409f856
sql:
CREATE TABLE embeddings (
    id INTEGER PRIMARY KEY,
    segment_id TEXT NOT NULL,
    embedding_id TEXT NOT NULL,
    seq_id BLOB NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    UNIQUE (segment_id, embedding_id)
);

CREATE TABLE embedding_metadata (
    id INTEGER REFERENCES embeddings(id),
    key TEXT NOT NULL,
    string_value TEXT,
    int_value INTEGER,
    float_value REAL,
    PRIMARY KEY (id, key)
);

CREATE TABLE max_seq_id (
    segment_id TEXT PRIMARY KEY,
    seq_id BLOB NOT NULL
);

CREATE VIRTUAL TABLE embedding_fulltext USING fts5(id, string_value);


dir: metadb
filename: 00002-embedding-metadata.sqlite.sql
hash: 12a570f7121b3a8ce750a2a7c36da20f
sql:
-- SQLite does not support adding check with alter table, as a result, adding a check
-- involve creating a new table and copying the data over. It is over kill with adding
-- a boolean type column. The application write to the table needs to ensure the data
-- integrity.
ALTER TABLE embedding_metadata ADD COLUMN bool_value INTEGER


dir: metadb
filename: 00003-full-text-tokenize.sqlite.sql
hash: f97ad6334aeaa8f419f01110b648b97a
sql:
CREATE VIRTUAL TABLE embedding_fulltext_search USING fts5(string_value, tokenize='trigram');
INSERT INTO embedding_fulltext_search (rowid, string_value) SELECT rowid, string_value FROM embedding_metadata;
DROP TABLE embedding_fulltext;


# embeddings_queue

created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 00d51468-6ad9-41de-8f18-864caa6229bb
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "Never use @Zomato food service, they deliver worst quality food and there help desk executive had no politness.\u2026 https://t.co/0vM6OJadjP\n@zomatocare @ZomatoIN Hi, I want a refund for my Zomato gold membership, I bought it at a separate set of T&amp;C's we\u2026 https://t.co/SV7lyOfZI6\n@SwiggyCares horrible experience with swiggy today. Received bad quality food from subway,  Had a word with custome\u2026 https://t.co/AzD70AKYWd\nVery bad service.\nIs the policy change even allowed after PPL buy Zomato Gold membership? @ZomatoIN https://t.co/aEULlvQEIc\nIn those situations, I usually open the Swiggy app at 1am and order something that I'll regret the next morning.\nWas scrolling through foodpanda, but couldn't decide what to eat so I closed the app. Dia keluar notification ni ay\u2026 https://t.co/U3Er9gbs8a\n@CatchDoon @Zomato @ZomatoIN @zomatocare Hi AD, We are sorry to hear this. We would like to assure you that we have\u2026 https://t.co/cAmwecsZVf"}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 483c60f8-9ee8-4968-b156-c5ccefffbec4
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "@CatchDoon @Zomato @ZomatoIN @zomatocare Hi AD, We are sorry to hear this. We would like to assure you that we have\u2026 https://t.co/cAmwecsZVf\n@SwiggyCares @harshamjty you guys are really good at spoiling some ones occassion.I have been cheated by you If you\u2026 https://t.co/AHCwR7AVYO\nRT @AkashVe51269968: @SwiggyCares @harshamjty you guys are really good at spoiling some ones occassion.I have been cheated by you If you ar\u2026\nI don\u2019t know why I choose swiggy for spoiling my Birth Day\nAlways knew that @ZomatoIN\n@Zomato sucks! Fucking up their delivery boys by not paying them appropriately as promis\u2026 https://t.co/oXITmvlxI7\n@foodpandaIndia Still NO RESPONSE!!!\nI sent my order ID as asked but nothing!!\nAfter being a loyal customer for mor\u2026 https://t.co/A1p7urrwJe\nGood bye @FoodPandapk \nWorst customer support. \nMy last few orders were delivered after 90 mins, upon inquiry I got\u2026 https://t.co/STlmkMZMDs\nNo response till now\nWorst experience with @Zomato @ZomatoIN"}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 37f840ae-64d4-4717-8e74-54dfb78ad5e7
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "Worst customer support. \nMy last few orders were delivered after 90 mins, upon inquiry I got\u2026 https://t.co/STlmkMZMDs\nNo response till now\nWorst experience with @Zomato @ZomatoIN\n@foodpandaIndia I ordered from my fav restaurant,  order  was placed 90 mins ago, driver has been 1 minute away  pe\u2026 https://t.co/cYqYLViQ9B\nThere is no number to contact @zomato\n@zomatocare @ZomatoIN @Zomato @swiggy_in @zomatocare your ASAP .. and its more than 2hrs..  Zomato monkeys! @ZomatoIN @Zomato\n@hansaraman @ZomatoIN @Zomato @zomatocare We should lawyer up\n@hansaraman @ZomatoIN @Zomato @zomatocare Invoke arbitration for unfair enrichment, damages, loss of food, and mental agony\n@foodpandaIndia #craveparty is such a #cheatoffer.Tried ordering using the code. During payments,got failed. Now ca\u2026 https://t.co/nwxxDhwBlS\n@ZomatoIN waiting for my my order for almost 2 hours not received the order yet . Talked to the zomato guys no supp\u2026 https://t.co/7rxEA9UMU6"}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 9f93cab9-4fb1-4e73-a1f3-1d0f678560cf
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "@ZomatoIN waiting for my my order for almost 2 hours not received the order yet . Talked to the zomato guys no supp\u2026 https://t.co/7rxEA9UMU6\nSwiggy/zomato delivery atrocity Vadivelu troll video | Chennai \u2013 Chennai\u00a0Video https://t.co/HH536LSGEa https://t.co/RFa22FaB4p\n@neil_shroff @ZomatoIN @Zomato @zomatocare Essentially everything thst sounds good on a Twitter bio?\nPerfect way to ruin your Sunday is to use @SwiggyCares. Every order is a struggle followed by random pathetic peopl\u2026 https://t.co/RZBGnt4IHp\nFoodPanda Loot- Get Rs 200 Food Order at just Rs 50 only https://t.co/Fnf13i05YU https://t.co/BvQzXjqNo4\n@inconsumerforum  complaint number #905673 is raised against @SwiggyCares Order number #1955858170. \nThanks for del\u2026 https://t.co/vegEhCvh7W\nFreaking pissed with foodpanda. Experienced TWO order cancelled today, one for lunch and another for dinner now. Ev\u2026 https://t.co/f2QVC7O5lU\nhttps://t.co/BDLe6Vma4e"}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 967783bf-d0e8-4272-9bae-a79a8016e51b
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "Freaking pissed with foodpanda. Experienced TWO order cancelled today, one for lunch and another for dinner now. Ev\u2026 https://t.co/f2QVC7O5lU\nhttps://t.co/BDLe6Vma4e\nYou guys are millionaire because we ....And treating these guys like this won't make you ma\u2026 https://t.co/PeX1hzO85m\nhttps://t.co/BDLe6Vma4e"}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 12c65eab-9990-4bb1-a780-ceebfbeb077d
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "@ZomatoIN @Zomato \nLook into this matter ...pretty serious and shameful for you guys\ud83d\ude10\ud83d\ude10\n@ankurkulkarni27 @Zomato Zomato delivers very poor quality food. We get good quality in same restaurant if we visit there insted\n@Zomato @ZomatoIN @zomatocare @zomato This is not done. You can not change conditions with which we have subscribed\u2026 https://t.co/TRtj36LccM\nRT @deep__sanghvi: @Zomato @ZomatoIN @zomatocare @zomato This is not done. You can not change conditions with which we have subscribed post\u2026\n@deepigoyal @Zomato Order no- 1168485461\nthis is horrible.. the butter chikhen is really nice and upto the mark.. b\u2026 https://t.co/rDp7NHBlJX\n@ZomatoIN @Zomato Order no- 1168485461\nthis is horrible.. the butter chikhen is really nice and upto the mark.. but\u2026 https://t.co/RNk4Q6FaAC\n@prabirkumarhal9 @deepigoyal @Zomato Kebab instead of tikka ? There's a catch."}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: 0bc0b123-92e0-4325-941a-aac9ca0bca72
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "We are getting this checked and we'\u2026 https://t.co/zcV070dyRj\n@swiggy_in @SwiggyCares \nHi Swiggy, wrong items were delivered twice in a single day. First time I didn't complain\u2026 https://t.co/S3XmvxntSO\n.@ZomatoIN What a pathetic services? Got a call from restaurant saying the delivery boy is unavailable! \n\nPh: 78350\u2026 https://t.co/DodcOhG1sa\n.@ZomatoIN @Zomato Order booked at 17:25, and its been 40 minutes! \n\nIs #Zomato seriously an online food app?\n@foodpandaIndia ORDER ID- b4ck-47qt. Order confirmed at 5.20pm, 30 minutes was expected time but till now order has\u2026 https://t.co/gGFwmgKtCT\n@zomatocare @deepigoyal @Zomato When!?... It's already 2 hours gone\n@krishanbajaj13 We believe you have contacted foodpanda Pakistan and would request you to contact your desired coun\u2026 https://t.co/4JT3g2DZvy\n.@Zomato @ZomatoIN This is seroius now! Even after 60 minutes no information on the food ordered."}


created_at: 2024-03-22 19:44:47
topic: persistent://default/default/93e764f4-22e6-4e60-8130-418ae0ae42f1
id: e466934e-45ba-4095-b72a-390103dc7e40
encoding: FLOAT32
metadata:
{"source": "./negative_reviews.txt", "chroma:document": "Please shut shops!\n@dominos_india Does the picture not speak. Check my order number 155. \n35546928130213222. Order placed with Swiggy\u2026 https://t.co/z6KQXstm9x\nRT @vilegenius: So @Zomato now that we can only use 1 gold per couple, are you planning to refund my membership?  I don't need it as my hus\u2026\nHow many minutes do you want from me, foodpanda? https://t.co/bhPq2Nzvh2"}


# embedding_metadata

key: chroma:document
string_value:
Never use @Zomato food service, they deliver worst quality food and there help desk executive had no politness.… https://t.co/0vM6OJadjP
@zomatocare @ZomatoIN Hi, I want a refund for my Zomato gold membership, I bought it at a separate set of T&amp;C's we… https://t.co/SV7lyOfZI6
@SwiggyCares horrible experience with swiggy today. Received bad quality food from subway,  Had a word with custome… https://t.co/AzD70AKYWd
Very bad service.
Is the policy change even allowed after PPL buy Zomato Gold membership? @ZomatoIN https://t.co/aEULlvQEIc
In those situations, I usually open the Swiggy app at 1am and order something that I'll regret the next morning.
Was scrolling through foodpanda, but couldn't decide what to eat so I closed the app. Dia keluar notification ni ay… https://t.co/U3Er9gbs8a
@CatchDoon @Zomato @ZomatoIN @zomatocare Hi AD, We are sorry to hear this. We would like to assure you that we have… https://t.co/cAmwecsZVf


key: chroma:document
string_value:
@CatchDoon @Zomato @ZomatoIN @zomatocare Hi AD, We are sorry to hear this. We would like to assure you that we have… https://t.co/cAmwecsZVf
@SwiggyCares @harshamjty you guys are really good at spoiling some ones occassion.I have been cheated by you If you… https://t.co/AHCwR7AVYO
RT @AkashVe51269968: @SwiggyCares @harshamjty you guys are really good at spoiling some ones occassion.I have been cheated by you If you ar…
I don’t know why I choose swiggy for spoiling my Birth Day
Always knew that @ZomatoIN
@Zomato sucks! Fucking up their delivery boys by not paying them appropriately as promis… https://t.co/oXITmvlxI7
@foodpandaIndia Still NO RESPONSE!!!
I sent my order ID as asked but nothing!!
After being a loyal customer for mor… https://t.co/A1p7urrwJe
Good bye @FoodPandapk 
Worst customer support. 
My last few orders were delivered after 90 mins, upon inquiry I got… https://t.co/STlmkMZMDs
No response till now
Worst experience with @Zomato @ZomatoIN


key: chroma:document
string_value:
Worst customer support. 
My last few orders were delivered after 90 mins, upon inquiry I got… https://t.co/STlmkMZMDs
No response till now
Worst experience with @Zomato @ZomatoIN
@foodpandaIndia I ordered from my fav restaurant,  order  was placed 90 mins ago, driver has been 1 minute away  pe… https://t.co/cYqYLViQ9B
There is no number to contact @zomato
@zomatocare @ZomatoIN @Zomato @swiggy_in @zomatocare your ASAP .. and its more than 2hrs..  Zomato monkeys! @ZomatoIN @Zomato
@hansaraman @ZomatoIN @Zomato @zomatocare We should lawyer up
@hansaraman @ZomatoIN @Zomato @zomatocare Invoke arbitration for unfair enrichment, damages, loss of food, and mental agony
@foodpandaIndia #craveparty is such a #cheatoffer.Tried ordering using the code. During payments,got failed. Now ca… https://t.co/nwxxDhwBlS
@ZomatoIN waiting for my my order for almost 2 hours not received the order yet . Talked to the zomato guys no supp… https://t.co/7rxEA9UMU6


key: chroma:document
string_value:
@ZomatoIN waiting for my my order for almost 2 hours not received the order yet . Talked to the zomato guys no supp… https://t.co/7rxEA9UMU6
Swiggy/zomato delivery atrocity Vadivelu troll video | Chennai – Chennai Video https://t.co/HH536LSGEa https://t.co/RFa22FaB4p
@neil_shroff @ZomatoIN @Zomato @zomatocare Essentially everything thst sounds good on a Twitter bio?
Perfect way to ruin your Sunday is to use @SwiggyCares. Every order is a struggle followed by random pathetic peopl… https://t.co/RZBGnt4IHp
FoodPanda Loot- Get Rs 200 Food Order at just Rs 50 only https://t.co/Fnf13i05YU https://t.co/BvQzXjqNo4
@inconsumerforum  complaint number #905673 is raised against @SwiggyCares Order number #1955858170. 
Thanks for del… https://t.co/vegEhCvh7W
Freaking pissed with foodpanda. Experienced TWO order cancelled today, one for lunch and another for dinner now. Ev… https://t.co/f2QVC7O5lU
https://t.co/BDLe6Vma4e


key: chroma:document
string_value:
Freaking pissed with foodpanda. Experienced TWO order cancelled today, one for lunch and another for dinner now. Ev… https://t.co/f2QVC7O5lU
https://t.co/BDLe6Vma4e
You guys are millionaire because we ....And treating these guys like this won't make you ma… https://t.co/PeX1hzO85m
https://t.co/BDLe6Vma4e


key: chroma:document
string_value:
@ZomatoIN @Zomato 
Look into this matter ...pretty serious and shameful for you guys😐😐
@ankurkulkarni27 @Zomato Zomato delivers very poor quality food. We get good quality in same restaurant if we visit there insted
@Zomato @ZomatoIN @zomatocare @zomato This is not done. You can not change conditions with which we have subscribed… https://t.co/TRtj36LccM
RT @deep__sanghvi: @Zomato @ZomatoIN @zomatocare @zomato This is not done. You can not change conditions with which we have subscribed post…
@deepigoyal @Zomato Order no- 1168485461
this is horrible.. the butter chikhen is really nice and upto the mark.. b… https://t.co/rDp7NHBlJX
@ZomatoIN @Zomato Order no- 1168485461
this is horrible.. the butter chikhen is really nice and upto the mark.. but… https://t.co/RNk4Q6FaAC
@prabirkumarhal9 @deepigoyal @Zomato Kebab instead of tikka ? There's a catch.


key: chroma:document
string_value:
We are getting this checked and we'… https://t.co/zcV070dyRj
@swiggy_in @SwiggyCares 
Hi Swiggy, wrong items were delivered twice in a single day. First time I didn't complain… https://t.co/S3XmvxntSO
.@ZomatoIN What a pathetic services? Got a call from restaurant saying the delivery boy is unavailable! 

Ph: 78350… https://t.co/DodcOhG1sa
.@ZomatoIN @Zomato Order booked at 17:25, and its been 40 minutes! 

Is #Zomato seriously an online food app?
@foodpandaIndia ORDER ID- b4ck-47qt. Order confirmed at 5.20pm, 30 minutes was expected time but till now order has… https://t.co/gGFwmgKtCT
@zomatocare @deepigoyal @Zomato When!?... It's already 2 hours gone
@krishanbajaj13 We believe you have contacted foodpanda Pakistan and would request you to contact your desired coun… https://t.co/4JT3g2DZvy
.@Zomato @ZomatoIN This is seroius now! Even after 60 minutes no information on the food ordered.


key: chroma:document
string_value:
Please shut shops!
@dominos_india Does the picture not speak. Check my order number 155. 
35546928130213222. Order placed with Swiggy… https://t.co/z6KQXstm9x
RT @vilegenius: So @Zomato now that we can only use 1 gold per couple, are you planning to refund my membership?  I don't need it as my hus…
How many minutes do you want from me, foodpanda? https://t.co/bhPq2Nzvh2


