Skip to content

☕ Generates sql diffs for all database changes. ☕

Notifications You must be signed in to change notification settings

vielhuber/magicdiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

☕ magicdiff ☕

magicdiff generates automagically sql diffs for a database between two given states.

Key benefits

  • Spits out real sql queries that can be applied on previous state
  • Does not use sql triggers or binary / ddl logs
  • Works with any shared hosting provider
  • Data and schema changes, at the same time
  • Fast
  • Command line tool and class usage possible
  • Covered through test suite
  • Returns (separate) diffs and patch files
  • Can ignore certain tables
  • Takes care of (primary) keys and all kinds or altering tables
  • Zero dependencies

Disclaimer

This does not prevent you from taking backups. Use this script at your own risk.

Command line

Installation

wget https://raw.githubusercontent.com/vielhuber/magicdiff/master/src/magicdiff.php

Usage

php magicdiff.php setup
php magicdiff.php init
php magicdiff.php diff

Class

Installation

composer require vielhuber/magicdiff

Usage

<?php
require __DIR__ . '/vendor/autoload.php';
use vielhuber\magicdiff\magicdiff;
magicdiff::setup();
magicdiff::init();
magicdiff::diff();

About

☕ Generates sql diffs for all database changes. ☕

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages