Skip to content

Commit

Permalink
feat: Compute hash on item upsert (#404)
Browse files Browse the repository at this point in the history
* feat: Compute hash on item upsert

* fix: Fix tests & urn building

* fix: Return the content_hash when upserting the item

* chore: Change the content hash column name

* fix: Compute the hash as its done in the Catalyst. Fix some tests

* fix: Tests

* fix: Wrong types

* fix: Remove useFakeTimers

* fix: Simplified the retrieval of local_content_hash in the third party item upsert

* fix: EntityMetadata types

* fix: Fix content hash

* fix: Verify that the item is published

* fix: Add rarity to the StandardWearableEntityMetadata

* fix: Tests

* fix: Link Wearable type to the entities type
  • Loading branch information
LautaroPetaccio committed Feb 28, 2022
1 parent 670d709 commit c2ab63c
Show file tree
Hide file tree
Showing 17 changed files with 1,767 additions and 15,457 deletions.
16 changes: 16 additions & 0 deletions migrations/1644869327994_add-column-to-store-content-hash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MigrationBuilder } from 'node-pg-migrate'
import { Item } from '../src/Item/Item.model'

const tableName = Item.tableName
const columnName = 'local_content_hash'

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumn(tableName, {
// Content-hash can be null if the item is not yet published for the DCL collections
[columnName]: { type: 'string', notNull: false },
})
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.dropColumn(tableName, columnName)
}
Loading

0 comments on commit c2ab63c

Please sign in to comment.