Add unique ID per post and an index to the db for that
This commit is contained in:
@@ -36,6 +36,7 @@ export function openDatabase(userID:string): Promise<IDBDatabase> {
|
||||
if (!db.objectStoreNames.contains(storeName)) {
|
||||
let store = db.createObjectStore(storeName, { keyPath: "id", autoIncrement: true });
|
||||
store.createIndex("datetimeIndex", "post_timestamp", { unique: false });
|
||||
store.createIndex("postIDIndex", "data.post_id", { unique: true });
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user