euskadi31/schema

SQL Schema manager

v0.1.0 2013-08-09 20:38 UTC

README

Feature

  • MySQL only (more next time).
  • Schema file format json and yaml.
  • Dump current database schema to json, yaml and sql format.

Schema

Json format (schema.json)

{
    "config": {
        "driver": "pdo_mysql",
        "host": "127.0.0.1",
        "port": "3306",
        "dbname": "demo",
        "user": "demo",
        "password": "demo",
        "charset": "utf8"
    },
    "schemas": []
}

Yaml format (schema.yml)

config:
    driver: pdo_mysql
    host: 127.0.0.1
    port: '3306'
    dbname: demo
    user: demo
    password: demo
    charset: utf8
schemas: ~

Usage

Create database schema.

php schema.phar create

Update database schema.

php schema.phar update --force

Dump database schema.

php schema.phar dump --format=sql