Skip to content
Closed
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
25 changes: 25 additions & 0 deletions db/migrations/20260226000000_add_milestone_document_references.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Migration: add milestone_document_references table
* Stores off-chain document references (URL + optional content hash)
* linked to vault milestones.
*/
exports.up = async function up(knex) {
await knex.schema.createTable('milestone_document_references', (table) => {
table.string('id', 64).primary()
table.string('vault_id', 64).notNullable().references('id').inTable('vaults').onDelete('CASCADE')
table.string('label', 255).notNullable()
table.string('url', 2048).notNullable()
table.string('content_hash', 128).nullable() // optional SHA-256 or similar
table.string('hash_algorithm', 32).nullable() // e.g. 'sha256'
table.timestamp('created_at', { useTz: true }).notNullable().defaultTo(knex.fn.now())
table.timestamp('updated_at', { useTz: true }).notNullable().defaultTo(knex.fn.now())
})

await knex.schema.alterTable('milestone_document_references', (table) => {
table.index(['vault_id'], 'idx_doc_refs_vault_id')
})
}

exports.down = async function down(knex) {
await knex.schema.dropTableIfExists('milestone_document_references')
}
6 changes: 2 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Config } from 'jest'

const config: Config = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
Expand All @@ -10,8 +9,7 @@ const config: Config = {
transform: {
'^.+\\.ts$': ['ts-jest', { useESM: true }],
},
testMatch: ['**/tests/**/*.test.ts'],
testMatch: ['**/*.test.ts'],
clearMocks: true,
}

export default config
export default config
Loading