Migrate is a tool for performing declarative migrations by finding differences between an expected database schema and the existing one, currently in a SQLite database. It also generates type-safe F# code with CRUD operations for your database schema.
If you just want to test the tool without installing .Net, then you can use a Docker image:
podman run -it 'mcr.microsoft.com/dotnet/sdk:10.0' bashInside the container run:
export PATH="$PATH:/root/.dotnet/tools"After having .Net in your system you can run
dotnet tool install --global migtoolmkdir test_db
cd test_db
mig init
# generated project files with example definitions
mig status
# output shows migration for existing definitions
mig commit
# generates and executes migration
mig log
# output shows migration metadata and a summary of executed steps
mig codegen
# generates type-safe F# code with CRUD operations- Declarative migrations
- Migration execution
- Migration execution as library
- F# code generation with type-safe CRUD operations
- Migration log
- Seed data management with idempotent upserts
mig init- Initialize a new migration project with example schema filesmig status- Generate migration SQL by comparing expected schema with current databasemig commit [-m <message>]- Generate and execute migrations step by stepmig schema- Show the current database schemamig log [-s <steps-id>]- Show migration history and execution metadatamig codegen [-d <directory>]- Generate type-safe F# code with CRUD operations from SQL schema filesmig seed- Execute seed statements (INSERT OR REPLACE) from SQL files
How to contribute:
- Open an issue to discuss the change and approach
- Add relevant tests
- Create a pull request mentioning the issue and also including a summary of the problem and approach to solve it
- Wait for the review
