• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

migration-script-runner / msr-core / 0f77c825-49cc-4295-bac5-acf672508335
100%

Build:
DEFAULT BRANCH: master
Ran 25 Nov 2025 10:08PM UTC
Jobs 1
Files 30
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Nov 2025 10:08PM UTC coverage: 100.0%. Remained the same
0f77c825-49cc-4295-bac5-acf672508335

push

circleci

Vova Lavrynovych
 #26: Add beforeMigrate file-based setup script with enhanced logging

Added support for beforeMigrate.ts/js file that executes before migration scanning. This allows users to load production snapshots, create extensions, or perform environment-specific setup before migrations run.

Core Implementation:
- Added config.beforeMigrateName (configurable, default: 'beforeMigrate')
- Created IMigrationService.getBeforeMigrateScript() method
- Implemented MigrationScriptExecutor.executeBeforeMigrate() with detailed logging
- Executes BEFORE migration scanning (allows database reset/erase)
- Uses IRunnableScript interface but NOT saved to schema version table
- Can be disabled by setting config.beforeMigrateName = null

Enhanced Logging:
- Detection phase logging with file path
- Execution start/completion with duration timing
- Conditional result logging (only when result exists)
- Clear "not found" message when script doesn't exist

Tests:
- Added 8 comprehensive beforeMigrate tests (353 tests total)
- Test file existence, execution, errors, disabling, and logging
- Improved test code quality with shared TEST_MIGRATION_CONTENT constant
- Fixed test fixtures to use proper IRunnableScript interface
- Maintained 100% coverage (572 statements, 282 branches, 141 functions, 532 lines)

Documentation:
- Updated getting-started.md with beforeMigrate examples and use cases
- Updated configuration.md with beforeMigrateName configuration details
- Updated api/index.md with new Config property and MigrationService method
- Added comprehensive section to writing-migrations.md guide
- Updated v0.2-to-v0.3.md migration guide with beforeMigrate feature

282 of 282 branches covered (100.0%)

Branch coverage included in aggregate %.

26 of 26 new or added lines in 3 files covered. (100.0%)

531 of 531 relevant lines covered (100.0%)

988.32 hits per line

Jobs
ID Job ID Ran Files Coverage
1 0f77c825-49cc-4295-bac5-acf672508335.1 25 Nov 2025 10:08PM UTC 30
100.0
Source Files on build 0f77c825-49cc-4295-bac5-acf672508335
  • Tree
  • List 30
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • CircleCI Build #0F77C825...
  • 72d7e4bb on github
  • Prev Build on master (#272482F5...)
  • Next Build on master (#1ABA2C8D...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc