PHPackages                             mysql/schematic - 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. mysql/schematic

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

mysql/schematic
===============

A simple MySQL migration management tool in PHP, create and update databases automatically with a config json file without having to use inbuilt ORM functions.

1.5.0(11y ago)207316[12 issues](https://github.com/andrefigueira/Schematic/issues)GPL-3.0+PHPPHP &gt;=5.3.2

Since Dec 12Pushed 10y ago6 watchersCompare

[ Source](https://github.com/andrefigueira/Schematic)[ Packagist](https://packagist.org/packages/mysql/schematic)[ Docs](http://andrefigueira.github.io/Schematic/)[ RSS](/packages/mysql-schematic/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (26)Used By (0)

Schematic - Database Migrations Tool
------------------------------------

[](#schematic---database-migrations-tool)

NO LONGER MAINTAINED
====================

[](#no-longer-maintained)

### Due to the fact that Schematic was never truly fully completed with all the features I wanted it to have, I'm shelving it for the time being, if anyone would like to become the new active contributer let me know. However I've now moved on to Laravel as my main framework and Laravel migrations have now taken over from Schematic.

[](#due-to-the-fact-that-schematic-was-never-truly-fully-completed-with-all-the-features-i-wanted-it-to-have-im-shelving-it-for-the-time-being-if-anyone-would-like-to-become-the-new-active-contributer-let-me-know-however-ive-now-moved-on-to-laravel-as-my-main-framework-and-laravel-migrations-have-now-taken-over-from-schematic)

A database migrations tool, allows for easy database maintenance in a way that is easy to setup in a continuous integration environment.

[![Build Status](https://camo.githubusercontent.com/c2d469635572218c0d19ab8e71fb9e1c2775760f68a6f39c3482b7b018bfc07e/68747470733a2f2f7472617669732d63692e6f72672f616e64726566696775656972612f536368656d617469632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andrefigueira/Schematic)[![Latest Stable Version](https://camo.githubusercontent.com/0c33f547e283d11550450c5c732804babd9e164680dbb1a3509c497053747d42/68747470733a2f2f706f7365722e707567782e6f72672f6d7973716c2f736368656d617469632f762f737461626c652e737667)](https://packagist.org/packages/mysql/schematic) [![Total Downloads](https://camo.githubusercontent.com/ee57bfb3f3bb48c8015c9528225091402c8b8feb07afeee88849158d16cb19a9/68747470733a2f2f706f7365722e707567782e6f72672f6d7973716c2f736368656d617469632f646f776e6c6f6164732e737667)](https://packagist.org/packages/mysql/schematic) [![Latest Unstable Version](https://camo.githubusercontent.com/7e1908343b436753a4b17c8bdd1ed71f65f7590c85625b236b44df633dc1d920/68747470733a2f2f706f7365722e707567782e6f72672f6d7973716c2f736368656d617469632f762f756e737461626c652e737667)](https://packagist.org/packages/mysql/schematic) [![License](https://camo.githubusercontent.com/3bc6e0c5b8039db5686da122c30688d0f5972c98ef2f1bae6e0900a076dedc0d/68747470733a2f2f706f7365722e707567782e6f72672f6d7973716c2f736368656d617469632f6c6963656e73652e737667)](https://packagist.org/packages/mysql/schematic)[![Bitdeli Badge](https://camo.githubusercontent.com/55b5c35e2bdc700d352c0de08bc97184d79c6e0b2905bc4df0bcb96724755a2d/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f616e64726566696775656972612f736368656d617469632f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")\###Install locally via Composer
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#---install-locally-via-composer)

```
{
    require: {
        "mysql/schematic": "1.*.*"
    }
}

```

\###Install it Globally
-----------------------

[](#install-it-globally)

- Run the following commands:

Download the PHAR file:

```
wget --no-check-certificate https://github.com/andrefigueira/Schematic/raw/master/schematic.phar

```

Make the PHAR package executable

```
chmod +x schematic.phar

```

Move it to the user bin folder

```
mv schematic.phar /usr/local/bin/schematic

```

Then use Schematic

```
schematic

```

Schematic will now be available globally for you!

\###Schema format
-----------------

[](#schema-format)

Schema is defined in schema files, these must be stored in the schema folder in json files representing the table they are for, e.g. (Make sure that you create the schema folder in the root of your project)

```
~/ProjectFolder/schemas/table_name.yaml

```

The schema file contains all of the configuration of the database in order to create it or amend it, see an example below.

In the current version you need to pass a type and null through always, you pass the length in parenthesis on the type field.

Schematic uses all of the base MySQL values so you just need to put them into this file and they will work, if you spell something incorrectly, it will stop running and throw and exception.

\###Example Schema
------------------

[](#example-schema)

```
schematic:
    name: Schematic
    version: 1.4.5
database:
    general:
        name: schematic
        charset: utf8
        collation: utf8_general_ci
        engine: InnoDB
    tables:
        hello_world:
            fields:
                id:
                    type: int(11)
                    'null': false
                    unsigned: true
                    autoIncrement: true
                    index: 'PRIMARY KEY'
                client_id:
                    type: int(24)
                    'null': false
                    unsigned: true
                    autoIncrement: false
                name:
                    type: varchar(128)
                    'null': false
                    unsigned: false
                    autoIncrement: false
                    rename: full_name
                description:
                    type: varchar(256)
                    'null': false
                    unsigned: false
                    autoIncrement: false
                created_date:
                    type: datetime
                    'null': false
                    unsigned: false
                    autoIncrement: false

```

---

Note that currently foreign keys are only added, but not removed, If created a new database with constraints, you must run the update twice to add the constraints.

##### Usage:

[](#usage)

- [Usage tutorial](https://www.youtube.com/watch?v=Y4hckSfzf4U)

`schematic  [options] command [arguments]`

##### Options:

[](#options)

`--help           -h Display this help message.`

`--quiet          -q Do not output any message.`

`--verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug`

`--version        -V Display this application version.`

`--ansi              Force ANSI output.`

`--no-ansi           Disable ANSI output.`

`--no-interaction -n Do not ask any interactive question.`

##### Available commands:

[](#available-commands)

`help                  Displays help for a command`

`list                  Lists commands`

##### Migrations

[](#migrations)

`migrations:execute    Executes the database migration based on the JSON schema files`

`migrations:generate   Generates the database schema JSON files`

`migrations:mapping    Generates the database schema based on an existing database`

The script also creates a log of all of the database changes which are made.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Recently: every ~4 days

Total

23

Last Release

4194d ago

PHP version history (2 changes)1.2.2PHP &gt;=5.3.0

1.4.8PHP &gt;=5.3.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a901aad2498f1239d81fe941bceb28b474885501b0bb92509c810aaacad1227?d=identicon)[andre](/maintainers/andre)

---

Top Contributors

[![andrefigueira](https://avatars.githubusercontent.com/u/806006?v=4)](https://github.com/andrefigueira "andrefigueira (104 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![saada](https://avatars.githubusercontent.com/u/1087987?v=4)](https://github.com/saada "saada (1 commits)")

---

Tags

phpautomationmigrationdatabaseormmysql

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mysql-schematic/health.svg)

```
[![Health](https://phpackages.com/badges/mysql-schematic/health.svg)](https://phpackages.com/packages/mysql-schematic)
```

###  Alternatives

[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10923.2k](/packages/awssat-laravel-sync-migration)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

203.7k](/packages/perplorm-perpl)[riverside/php-orm

PHP ORM micro-library and query builder

111.2k](/packages/riverside-php-orm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
