PHPackages                             dconco/schema-migrator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dconco/schema-migrator

ActiveLibrary[Database &amp; ORM](/categories/database)

dconco/schema-migrator
======================

A beautiful command-line database migration tool for any PHP project. Laravel-style migrations without the framework.

v0.0.2(5d ago)78MITPHPPHP ^8.1

Since Sep 8Pushed 6mo agoCompare

[ Source](https://github.com/dconco/php-schema-migrator)[ Packagist](https://packagist.org/packages/dconco/schema-migrator)[ RSS](/packages/dconco-schema-migrator/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (8)Versions (3)Used By (0)

Schema Migrator
===============

[](#schema-migrator)

A beautiful command-line database migration tool for any PHP project. Laravel-style migrations without the framework complexity.

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Features
--------

[](#features)

✨ **Beautiful CLI Interface** - Powered by Symfony Console with colored output and interactive commands
🚀 **Global Installation** - Install once, use anywhere in any PHP project
🔧 **Zero Dependencies** - No need to install Laravel or any framework in your projects
📁 **Project-Based Config** - Each project maintains its own configuration and migrations
🗄️ **Multi-Database Support** - MySQL, PostgreSQL, SQLite, and SQL Server
⚡ **Laravel-Compatible** - Uses Laravel's proven migration syntax and features

---

Global Installation
-------------------

[](#global-installation)

Install Schema Migrator globally via Composer:

```
composer global require dconco/schema-migrator
```

Make sure your global Composer bin directory is in your PATH:

```
# Add to your ~/.bashrc or ~/.zshrc
export PATH="$PATH:$HOME/.composer/vendor/bin"
```

---

Quick Start
-----------

[](#quick-start)

### 1. Initialize in Your Project

[](#1-initialize-in-your-project)

Navigate to your PHP project and initialize Schema Migrator:

```
cd /path/to/your/project
schema-migrator init
```

This will:

- Create a `schema-migrator.yml` configuration file
- Create a `database/migrations` directory
- Prompt you for database connection details

### 2. Create Your First Migration

[](#2-create-your-first-migration)

```
schema-migrator make:migration CreateUsersTable
```

### 3. Edit the Migration

[](#3-edit-the-migration)

Edit the generated file in `database/migrations/`:

```
