DbEpoch 2.1.0
dotnet tool install --global DbEpoch --version 2.1.0
dotnet new tool-manifest
dotnet tool install --local DbEpoch --version 2.1.0
#tool dotnet:?package=DbEpoch&version=2.1.0
nuke :add-package DbEpoch --version 2.1.0
<div align="center">
<img src="./icon.png" alt="DbEpoch" width="120">
DbEpoch
Database migrations that ship.
A Flyway-style migration tool for PostgreSQL, SQL Server, MySQL, and SQLite.
<br>
Documentation · Report Bug · Request Feature
</div>
What is DbEpoch?
DbEpoch is a SQL-first database migration tool for .NET. You write plain .sql files, and DbEpoch tracks, validates, and applies them across environments — with built-in safety features for production use.
Why not Entity Framework migrations? EF migrations are tightly coupled to your application code and hard to control in production. DbEpoch keeps migrations as standalone SQL files that live in your repository, work with any language or framework, and give you full control over what runs and when.
Features
- SQL-first — Plain
.sqlfiles. No embedded DSL, no XML, no surprises. - Multi-database — PostgreSQL, SQL Server, MySQL, and SQLite. Switch providers without changing your workflow.
- Safe by design — Distributed locks, approval gates, deployment windows, and audit trails.
- CI-friendly — Every command supports
--jsonoutput and deterministic exit codes. - Works offline — Validate, plan, and scaffold without a database connection.
- Checksum integrity — SHA-256 checksums detect when previously-applied scripts are edited in place.
Quick Start
# Install (no .NET required)
curl -fsSL https://github.com/AzimMahmud/DbEpoch/releases/latest/download/install.sh | bash
# Scaffold a project
DbEpoch new --name MyApp --provider postgresql
# Create a migration
DbEpoch create --name CreateUsersTable --type schema
# Validate & preview
DbEpoch validate
DbEpoch plan
# Deploy
DbEpoch migrate -c "Host=localhost;Database=myapp;Username=postgres"
Installation
No .NET SDK or runtime required — the binary is self-contained.
# Linux / macOS
curl -fsSL https://github.com/AzimMahmud/DbEpoch/releases/latest/download/install.sh | bash
# Windows (PowerShell)
powershell -c "iwr -Uri https://github.com/AzimMahmud/DbEpoch/releases/latest/download/install.ps1 | iex"
# .NET global tool (requires .NET 10 SDK)
dotnet tool install --global DbEpoch
Manual Download
| Platform | Download |
|---|---|
| Windows x64 | DbEpoch-windows-x64.zip |
| Windows ARM64 | DbEpoch-windows-arm64.zip |
| Linux x64 | DbEpoch-linux-x64.tar.gz |
| Linux ARM64 | DbEpoch-linux-arm64.tar.gz |
| Linux musl x64 (Alpine) | DbEpoch-linux-musl-x64.tar.gz |
| macOS x64 | DbEpoch-macos-x64.tar.gz |
| macOS ARM64 | DbEpoch-macos-arm64.tar.gz |
Commands
| Command | Description | DB Required |
|---|---|---|
new |
Scaffold a complete project | No |
create |
Create a migration script | No |
validate |
Check scripts for errors | No |
plan |
Preview execution plan | No |
info |
Show configuration | No |
init |
Create tracking tables | Yes |
migrate |
Apply pending migrations | Yes |
status |
Show migration status | Yes |
rollback |
Undo migrations | Yes |
repair |
Fix failed migrations | Yes |
history |
View audit trail | Yes |
Run DbEpoch <command> --help for command-specific options.
Configuration
DbEpoch uses a two-tier JSON configuration:
// Database/Config/migration.json
{
"migration": {
"database": {
"provider": "postgresql",
"connectionString": "${DB_CONNECTION_STRING}"
},
"scripts": {
"path": "./Database/Migrations"
},
"execution": {
"batchSize": 10,
"stopOnFailure": true
}
}
}
Per-environment overrides in Database/Config/environments/<name>.json with ${VAR} expansion for secrets. See the Configuration Guide for details.
Supported Databases
| Provider | Version | Config Value |
|---|---|---|
| PostgreSQL | 12+ | postgresql |
| SQL Server | 2016+ | sqlserver |
| MySQL / MariaDB | 8+ / 10.5+ | mysql |
| SQLite | 3 | sqlite |
Documentation
Full documentation is available at azimmahmud.github.io/DbEpoch.
Building from Source
git clone https://github.com/AzimMahmud/DbEpoch.git
cd DbEpoch
dotnet build DbEpoch.slnx
dotnet test DbEpoch.slnx --filter "Category!=Integration"
Requires the .NET 10 SDK.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|