diff --git a/indexes/gitops/read-models/accounts.json b/indexes/gitops/read-models/accounts.json new file mode 100644 index 0000000..8874172 --- /dev/null +++ b/indexes/gitops/read-models/accounts.json @@ -0,0 +1,40 @@ +{ + "databaseName": "read-models", + "collectionName": "accounts", + "indexes": [ + { + "key": { + "_id": 1 + }, + "name": "_id_", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "gitopsUsage.cronRunId": 1 + }, + "name": "gitopsUsage.cronRunId_1", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } + ] +} diff --git a/indexes/gitops/read-models/application-tree.json b/indexes/gitops/read-models/application-tree.json deleted file mode 100644 index 53e87a4..0000000 --- a/indexes/gitops/read-models/application-tree.json +++ /dev/null @@ -1,360 +0,0 @@ -{ - "databaseName": "read-models", - "collectionName": "application-tree", - "indexes": [ - { - "key": { - "__passiveReferencedBy.name": 1 - }, - "name": "__passiveReferencedBy.name_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__passiveReferencedBy.name": 1, - "__passiveReferencedBy.kind": 1, - "__passiveReferencedBy.namespace": 1, - "__passiveReferencedBy.group": 1, - "__passiveReferencedBy.version": 1 - }, - "name": "__passiveReferencedBy.name_1___passiveReferencedBy.kind_1___passiveReferencedBy.namespace_1___passiveReferencedBy.group_1___passiveReferencedBy.version_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__passiveReferences.name": 1 - }, - "name": "__passiveReferences.name_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__passiveReferences.name": 1, - "__passiveReferences.kind": 1, - "__passiveReferences.namespace": 1, - "__passiveReferences.group": 1, - "__passiveReferences.version": 1 - }, - "name": "__passiveReferences.name_1___passiveReferences.kind_1___passiveReferences.namespace_1___passiveReferences.group_1___passiveReferences.version_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__inferredReferencedBy.name": 1 - }, - "name": "__inferredReferencedBy.name_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__inferredReferencedBy.name": 1, - "__inferredReferencedBy.kind": 1, - "__inferredReferencedBy.namespace": 1, - "__inferredReferencedBy.group": 1, - "__inferredReferencedBy.version": 1 - }, - "name": "__inferredReferencedBy.name_1___inferredReferencedBy.kind_1___inferredReferencedBy.namespace_1___inferredReferencedBy.group_1___inferredReferencedBy.version_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__inferredReferences.name": 1 - }, - "name": "__inferredReferences.name_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "__inferredReferences.name": 1, - "__inferredReferences.kind": 1, - "__inferredReferences.namespace": 1, - "__inferredReferences.group": 1, - "__inferredReferences.version": 1 - }, - "name": "__inferredReferences.name_1___inferredReferences.kind_1___inferredReferences.namespace_1___inferredReferences.group_1___inferredReferences.version_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "updatedAt": 1 - }, - "name": "updatedAt_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "projects": 1 - }, - "name": "projects_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "metadata.name": 1 - }, - "name": "metadata.name_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "metadata.labels": 1 - }, - "name": "metadata.labels_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "source.syncStartedAt": 1 - }, - "name": "source.syncStartedAt_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "source.gitSource": 1 - }, - "name": "source.gitSource_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "favorites": 1 - }, - "name": "favorites_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "metadata.accountId": 1, - "status.healthStatus": 1 - }, - "name": "metadata.accountId_1_status.healthStatus_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "metadata.accountId": 1, - "metadata.runtime": 1, - "metadata.cluster": 1, - "metadata.namespace": 1, - "metadata.group": 1, - "metadata.version": 1, - "metadata.kind": 1, - "metadata.name": 1 - }, - "name": "metadata.accountId_1_metadata.runtime_1_metadata.cluster_1_metadata.namespace_1_metadata.group_1_metadata.version_1_metadata.kind_1_metadata.name_1", - "unique": true, - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "source.gitSourceUID": 1 - }, - "name": "source.gitSourceUID_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "source.gitSourceNamespace": 1 - }, - "name": "source.gitSourceNamespace_1", - "collation": { - "locale": "en_US", - "caseLevel": false, - "caseFirst": "off", - "strength": 1, - "numericOrdering": false, - "alternate": "non-ignorable", - "maxVariable": "punct", - "normalization": false, - "backwards": false - } - }, - { - "key": { - "_id": 1 - }, - "name": "_id_" - } - ] -} diff --git a/indexes/gitops/read-models/product-components.json b/indexes/gitops/read-models/product-components.json index e26bda3..f1277ce 100644 --- a/indexes/gitops/read-models/product-components.json +++ b/indexes/gitops/read-models/product-components.json @@ -161,6 +161,31 @@ "_id": 1 }, "name": "_id_" + }, + { + "key": { + "accountId": 1, + "application.release.appVersions.appVersion": 1 + }, + "name": "accountId_1_application.release.appVersions.appVersion_1" + }, + { + "key": { + "accountId": 1, + "application.runtime": 1, + "application.deployedTo.namespace": 1, + "application.deployedTo.name": 1 + }, + "name": "accountId_1_application.runtime_1_application.deployedTo.namespace_1_application.deployedTo.name_1" + }, + { + "key": { + "accountId": 1, + "application.runtime": 1, + "application.deployedTo.namespace": 1, + "application.deployedTo.server": 1 + }, + "name": "accountId_1_application.runtime_1_application.deployedTo.namespace_1_application.deployedTo.server_1" } ] } diff --git a/indexes/gitops/read-models/product-releases.json b/indexes/gitops/read-models/product-releases.json index 0970a1f..eaa17a3 100644 --- a/indexes/gitops/read-models/product-releases.json +++ b/indexes/gitops/read-models/product-releases.json @@ -100,6 +100,13 @@ "_id": 1 }, "name": "_id_" + }, + { + "key": { + "createdAt": 1 + }, + "name": "createdAt_1", + "expireAfterSeconds": 23328000 } ] } diff --git a/indexes/gitops/read-models/promotion-tasks.json b/indexes/gitops/read-models/promotion-tasks.json new file mode 100644 index 0000000..9afab86 --- /dev/null +++ b/indexes/gitops/read-models/promotion-tasks.json @@ -0,0 +1,23 @@ +{ + "databaseName": "read-models", + "collectionName": "promotion-tasks", + "indexes": [ + { + "key": { + "_id": 1 + }, + "name": "_id_", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } + ] +} diff --git a/indexes/gitops/read-models/promotions.json b/indexes/gitops/read-models/promotions.json new file mode 100644 index 0000000..a5820a0 --- /dev/null +++ b/indexes/gitops/read-models/promotions.json @@ -0,0 +1,42 @@ +{ + "databaseName": "read-models", + "collectionName": "promotions", + "indexes": [ + { + "key": { + "_id": 1 + }, + "name": "_id_", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "accountId": 1, + "productName": 1, + "triggerCommit.sha": 1 + }, + "name": "accountId_1_productName_1_triggerCommit.sha_1", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } + ] +} diff --git a/package.json b/package.json index 3ef7a9c..29e0c79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "index-alignment", - "version": "0.3.0", + "version": "0.4.0", "main": "dist/index.js", "private": true, "type": "module", @@ -19,8 +19,8 @@ "test": "vitest run", "test:watch": "vitest", "test:cov": "vitest run --coverage", - "dump:classic": "rimraf ./indexes/classic && node ./dist/index.js dump -p ./indexes/classic -u $MONGO_V1_URI", - "dump:gitops": "rimraf ./indexes/gitops && node ./dist/index.js dump -p ./indexes/gitops -u $MONGO_V2_URI", + "dump:classic": "rimraf ./indexes/classic && node ./dist/index.js dump -p ./indexes/classic -u $MONGO_V1_URI --tls", + "dump:gitops": "rimraf ./indexes/gitops && node ./dist/index.js dump -p ./indexes/gitops -u $MONGO_V2_URI --tls", "dump": "yarn dump:classic && yarn dump:gitops" }, "engines": {