https://github.com/ovidyou/database-table-diff
Database Table Diff
A quick way to compare databases from multiple sources (MySQL, PostgreSQL, SQLite) and see differences between table structures.
Current status: compares table names and tables column names.
Features
Saves time comparing database table structures
Supports MySQL, PostgreSQL, SQLite
Cross-comparision between different database engines
Easy setup and configuration
Compatible with PHP 5.0 and later
Why you might need it
Migrating database schema changes from dev, to test, to production can end up unsuccessfull at times. You need a way to quickly check if there are differences between databases and this is where this tool comes handy.
After migrating a database to a new database engine (e.g. from MySQL to PostgreSQL), you need to ensure that all tables and their respective columns have been successfully migrated.
There are many other scenarios when you would need a quick way to compare databases.
License
This software is licenced under the GPL 3. Please read LICENSE for information on the software availability and distribution.
Setup / Configuration
Before you can use it, you need to ensure you have the proper PDO drivers installed.
Then you can just copy the files under this project into a folder that is accessible to a web server, so you can run it in your browser.
An example configuration can be seen in the provided example.php, or below:
<?php
// Include the class definition
require 'DatabaseTableDiff.php';
// Database configurations
// You can add as many databases as you wish,
// but note that the first one you declare will be compared with all the rest.
$databases['initial_db'] = array(
'driver' => 'pgsql',
'host' => 'localhost',
'port' => '',
'dbname' => 'my_initial_db',
'user' => 'root',
'pass' => 'root',
);
$databases['migrated_db'] = array(
'driver' => 'mysql',
'host' => 'localhost',
'port' => '',
'dbname' => 'my_migrated_db',
'user' => 'root',
'pass' => 'root',
);
// Create a new instance of DatabaseTableDiff.
$DTD = new DatabaseTableDiff($databases);
// Print a html formatted output of the tables differences.
print $DTD->getFormattedTablesDiff();
TODO
Add column properties diff for tables
Support more database engines
Database Table Diff
前往
- Software
- ↳ CodeCharge Studio
- ↳ CodeCharge
- ↳ DemoCharge
- ↳ SuperPDF
- ↳ 551einv
- ↳ E3進銷存
- 程式語言
- ↳ PHP
- ↳ CodeLobster PHP Edition
- ↳ Yii
- ↳ CodeIgniter
- ↳ Phalcon
- ↳ Symfony
- ↳ FuelPHP
- ↳ Zend Framework 2
- ↳ laravel
- ↳ WordPress
- ↳ ASP.NET/C#
- ↳ ASP/VBScript
- ↳ JSP
- ↳ Java Servlets
- ↳ ColdFusion
- ↳ Perl
- ↳ Java Script
- ↳ jQuery
- ↳ HTML + CSS
- ↳ jQuery
- ↳ nodejs
- ↳ VB6
- ↳ Git
- ↳ App Inventor 2
- ↳ bash
- ↳ C++/ VC/ OpenCV
- ↳ OpenCV
- ↳ go
- ↳ cordova
- ↳ python
- ↳ Xamarin
- ↳ Assembly
- 資料庫
- ↳ MySQL
- ↳ PostgreSQL
- ↳ ORACLE
- ↳ Access
- ↳ SQL Server
- ↳ SQLite
- ↳ MariaDB
- ↳ Mongodb
- 作業系統
- ↳ Linux
- ↳ Ubuntu
- ↳ CentOS
- ↳ Mint
- ↳ Mandriva
- ↳ Debian
- ↳ Red Hat Enterprise Linux
- ↳ Oracle Linux
- ↳ Fedora
- ↳ Kali Linux
- ↳ OpenSUSE
- ↳ Elementary OS
- ↳ Microsoft
- ↳ Server 2008 R2
- ↳ Server 2012 R2
- ↳ Server 2012
- ↳ 8
- ↳ 10
- ↳ System Center 2016
- ↳ NOVELL
- ↳ FreeBSD
- ↳ VMware
- ↳ VirtualBox
- ↳ Mac OS X
- ↳ Solaris
- ↳ iOS
- ↳ Android
- ↳ Cloud
- ↳ OpenStack
- ↳ Docker
- ↳ Proxmox VE
- ↳ CloudReady
- ↳ chrome
- 網頁伺服器
- ↳ apache
- ↳ tomcat
- ↳ nginx
- ↳ IIS
- ↳ JBoss
- ↳ weblogic
- ↳ WebHosting
- 硬體
- ↳ 硬體及週邊
- ↳ RouterOS
- ↳ LEGO NXT
- ↳ Arduino
- ↳ MSP430
- ↳ Raspberry Pi
- ↳ OpenERP
- ↳ Storage
- ↳ Server
- ↳ Brocade
- ↳ MODELS
- ↳ FortiGate
- 軟體
- ↳ sublime
- ↳ LibreNMS