Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.2.11",
"version": "1.2.12",
"main": "index.ts",
"license": "BUSL-1.1",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/resolvers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ProjectModel = require('../models/project').default;
const EVENTS_GROUP_HASH_INDEX_NAME = 'groupHashUnique';
const REPETITIONS_GROUP_HASH_INDEX_NAME = 'groupHash_hashed';
const REPETITIONS_USER_ID_INDEX_NAME = 'userId';
const EVENTS_TIMESTAMP_INDEX_NAME = 'timestamp';
const MAX_SEARCH_QUERY_LENGTH = 50;

/**
Expand Down Expand Up @@ -124,6 +125,13 @@ module.exports = {
sparse: true,
});

await projectEventsCollection.createIndex({
timestamp: 1,
}, {
name: EVENTS_TIMESTAMP_INDEX_NAME,
sparse: true,
});

telegram.sendMessage(`🤯 Project ${name} was created`);

return project;
Expand Down
Loading