feat(backend): add Knex database migration system#173
Merged
Fatimasanusi merged 4 commits intoJun 28, 2026
Conversation
Closes Trust-Analysis#91 - Add knexfile.js with SQLite (dev/test) and PostgreSQL (prod) config - Add initial migration: 20260628000000_create_assets_table.js - Add npm scripts: migrate, migrate:rollback, migrate:make, migrate:status - Add knex, better-sqlite3, pg to dependencies - Add docs/migrations.md with full usage guide - Update .env.example with DATABASE_URL
|
@KarenZita01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…uplicate useSoroban import
E2E tests expect mock wallet behaviour (Connect Freighter button, mock public key) but the workflow was building and running tests without VITE_MOCK_WALLET set, causing all Playwright tests to fail.
…NTRACT_ID
new Contract('PLACEHOLDER') throws at module load time because
'PLACEHOLDER' is not a valid Stellar contract address. Moved the
Contract construction into a lazy getter so the app renders
correctly when the contract ID is not yet configured (e.g. in CI
E2E tests that use VITE_CONTRACT_ID=PLACEHOLDER).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #91
Implements a database migration system using Knex.js, ready for when a persistent database is introduced.
Checklist
create_assets_tablewith core columns and rollbackpackage.jsonChanges
backend/knexfile.jsbackend/migrations/20260628000000_create_assets_table.jsassetstablebackend/docs/migrations.mdbackend/package.jsonmigrate,migrate:rollback,migrate:make,migrate:statusscripts; addedknex,better-sqlite3,pgdepsbackend/.env.exampleDATABASE_URLdocumentationMigration commands
Migration state tracking
Knex automatically creates a
knex_migrationstable on first run to record which migrations have been applied and in which batch — enabling safe rollbacks.