Skip to content

Commit

Permalink
Update observability to 1.4.1, fix index btree type test (#2855)
Browse files Browse the repository at this point in the history
* Update observablity to 0.14.1, fix index btree type test

* bug(core): Fix index type due to knex 2.5.0 changes

Knex 2.5.0 fixed the behavior of the index type. Previously indices would be
created with the default postgres index type of btree. To maintain previous
behavior, we need to set all indices to have type of btree rather than hash.

See knex/knex#5601 for more information on change.

---------

Co-authored-by: Sergey Ukustov <sergey@ukstv.me>
(cherry picked from commit 92bfbce)
  • Loading branch information
3benbox authored and stbrody committed Jul 11, 2023
1 parent ce5f42d commit 0cbec76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Expand Up @@ -47,7 +47,7 @@
"@ceramicnetwork/http-client": "^2.26.0-rc.0",
"@ceramicnetwork/ipfs-daemon": "^2.22.0-rc.0",
"@ceramicnetwork/logger": "^2.5.0",
"@ceramicnetwork/observability": "^1.2.0",
"@ceramicnetwork/observability": "^1.4.1",
"@ceramicnetwork/stream-tile": "^2.25.0-rc.0",
"@ceramicnetwork/streamid": "^2.16.0-rc.0",
"@stablelib/random": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Expand Up @@ -46,7 +46,7 @@
"@ceramicnetwork/codecs": "^1.4.0-rc.0",
"@ceramicnetwork/common": "^2.29.0-rc.0",
"@ceramicnetwork/ipfs-topology": "^2.23.0-rc.0",
"@ceramicnetwork/observability": "^1.2.0",
"@ceramicnetwork/observability": "^1.4.1",
"@ceramicnetwork/pinning-aggregation": "^2.21.0-rc.0",
"@ceramicnetwork/pinning-ipfs-backend": "^2.21.0-rc.0",
"@ceramicnetwork/stream-caip10-link": "^2.24.0-rc.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/indexing/migrations/1-create-model-table.ts
Expand Up @@ -51,32 +51,32 @@ export function indices(tableName: string): TableIndices {
{
keys: ['stream_id'],
name: `idx_${indexName}_stream_id`,
indexType: 'hash',
indexType: 'btree',
},
{
keys: ['last_anchored_at'],
name: `idx_${indexName}_last_anchored_at`,
indexType: 'hash',
indexType: 'btree',
},
{
keys: ['first_anchored_at'],
name: `idx_${indexName}_first_anchored_at`,
indexType: 'hash',
indexType: 'btree',
},
{
keys: ['created_at'],
name: `idx_${indexName}_created_at`,
indexType: 'hash',
indexType: 'btree',
},
{
keys: ['updated_at'],
name: `idx_${indexName}_updated_at`,
indexType: 'hash',
indexType: 'btree',
},
{
keys: ['last_anchored_at', 'created_at'],
name: `idx_${indexName}_last_anchored_at_created_at`,
indexType: 'hash',
indexType: 'btree',
},
]

Expand Down Expand Up @@ -229,7 +229,7 @@ export async function createConfigTable(dataSource: Knex, tableName: string, net
table.string('updated_by', 1024).notNullable()

table.index(['is_indexed'], `idx_ceramic_is_indexed`, {
storageEngineIndexType: 'hash',
indexType: 'btree',
})
})
break
Expand Down

0 comments on commit 0cbec76

Please sign in to comment.