Skip to content

feat(db): add migration completeness check script (closes #103)#155

Open
zeroknowledge0x wants to merge 1 commit into
Core-Foundry:mainfrom
zeroknowledge0x:feat/issue-103-migration-check
Open

feat(db): add migration completeness check script (closes #103)#155
zeroknowledge0x wants to merge 1 commit into
Core-Foundry:mainfrom
zeroknowledge0x:feat/issue-103-migration-check

Conversation

@zeroknowledge0x

Copy link
Copy Markdown
Contributor

Automated PR from bounty executor shipper.

…y#103)

Adds a CI-runnable script that verifies the schema_migrations tracking
row is in sync with the on-disk schema.sql. Catches the class of bugs
where migration files are added but the database initialize() function
stops mid-way, leaving the schema half-applied.

Changes:
- src/database/schema.sql: add schema_migrations table (single-row)
- src/database/database.ts: record schema_hash on initialize(), refresh on re-init
- src/scripts/migration-check.ts: standalone check script
- src/scripts/__tests__/migration-check.test.ts: 3 unit tests
- package.json: add migrate:check npm script
- .github/workflows/ci.yml: run migrate then migrate:check in CI

Refs Core-Foundry#103

Signed-off-by: zeroknowledge0x <zeroknowledge0x@users.noreply.github.com>
@Abd-Standard

Copy link
Copy Markdown
Collaborator

fix CI checks please and resolve conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevOps] Add Automatic Database Migration Check

2 participants