Download the PHP package eril/migraw without Composer
On this page you can find all versions of the php package eril/migraw. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package migraw
Short Description Simple SQL-first migrations for PHP.
License MIT
Homepage https://github.com/erilshackle/php-migraw
Informations about the package migraw
Migraw
SQL-first migrations for PHP.
Write SQL. Not magic.
Migraw is a lightweight migration tool that embraces SQL instead of hiding it.
Write raw SQL when you need complete control, generate smart SQL templates to get started quickly, or use the optional schema builder for common table operations.
Features
- SQL-first migrations
- Raw SQL support
- Lightweight schema builder
- Smart migration templates
- MySQL, MariaDB, PostgreSQL and SQLite support
- Driver-aware schema helpers
- Migration batches
- Rollback support
- Dry-run mode
- Interactive CLI
- PDO or callable connection
- Framework agnostic
- Zero runtime dependencies
Installation
Getting Started
Generate the default configuration:
or choose a specific driver:
This creates:
Configuration
Using a connection array:
Or provide a PDO instance:
Or a callable:
Creating a Migration
Create an empty migration:
Example:
Raw SQL
Smart Templates
Migraw can generate SQL templates based on the migration name.
Example:
generates:
Schema Builder
Multiple Statements
Running Migrations
Run pending migrations:
or
Rollback the last batch:
Rollback every executed migration:
Rollback everything and migrate again:
Show migration status:
Dry Run
Preview SQL without executing it:
or
Migration Philosophy
Treat migrations as immutable.
Instead of editing an existing migration:
create a new one:
This keeps every environment synchronized and preserves migration history.
Philosophy
Migraw is built around a simple idea:
SQL is already a schema language.
Instead of replacing SQL with a complex abstraction, Migraw keeps SQL visible and explicit.
You choose the level of abstraction that best fits your project:
- Raw SQL
- Smart SQL templates
- Lightweight schema builder
Nothing more.
Requirements
- PHP 8.1+
- PDO extension
Supported databases:
- MySQL
- MariaDB
- PostgreSQL
- SQLite
Testing
License
MIT License
Copyright (c) 2026 Eril TS Carvalho
All versions of migraw with dependencies
ext-pdo Version *