Download .zip |
Info | Documentation | View files (11) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2018-01-16 (21 days ago) | Not yet rated by the users | Total: 1 This week: 1 | All time: 9,151 This week: 516 |
Version | License | PHP version | Categories | |||
kdbv 1.0 | Custom (specified... | 5 | PHP 5, Databases, Systems administration |
Description | Author | |||||||||||||
This package implements a tool to migrate MySQL schema to another MySQL database. |
|
`kdbv library
` migrations between versions of a application.![](https://github.com/GaneshKandu/kdbv/blob/master/.github/kdbv.png)
> upgrade your mysql database to current latest version from older version
`
kdbv database file`
`
kdbv library`
is code that changes the database structure between versionsLike the source files in our project,the database is constantly changing too. That?s why we also need a way to track the changes of database versioning but using `
kdbv`
you don't need to keep track of changes just run make to create `
kdbv database`
and deploy with your latest change and run `
update`
function to change database automatically database upgraded thats is it
PHP 5.3+ and PDO extension installed
This library is designed to be installed via Composer.
Add the dependency into your projects composer.json.
{
"require": {
"ganeshkandu/kdbv": "*"
}
}
Download the composer.phar
curl -sS https://getcomposer.org/installer | php
Install the library.
php composer.phar install
> To add in in your dependencies
php composer.phar require ganeshkandu/kdbv
This library requires an autoloader, if you aren't already using one you can include Composers autoloader.
require('vendor/autoload.php');
`
kdbv database`
using `
make`
function of your `
latest database`
`
kdbv database`
with your application`
kdbv database`
and `
kdbv library`
) `
upgrade`
your database using `
upgrade`
function// Using kdbv namespace
namespace kanduganesh;
// just use this code to require auto loader on the top of your projects.
require 'vendor/autoload.php';
// Initialize
$obj = new kdbv(array(
'HOST' => '<mysql_host>',
'DATABASE' => '<mysql_database>',
'USER' => '<database_user>',
'PASS' => '<database_password>',
'PORT' => '<mysql_port>',
'KDBV' => '<kdbv_database_name>' //name of kdbv database
'PREFIX' => '<table prefix>', //table prefix
));
> `
<kdbv_database_name>`
is a name of `
kdbv database`
which to be deploy with your application
( _kdbv database contain database structure of your latest application_ )
> use `
$obj`
of step 1
`
kdbv database`
/*
Create kdbv database
notes :- during calling make function your mysql database should contain latest version database so it can store latest structure of database
*/
$obj->make();
> use `
$obj`
of step 1
$sqls_queries = $obj->query();
foreach($sqls_queries as $query){
echo $query."\n";
}
/*
upgrade mysql database
notes :- during calling upgrade function your kdbv database should be deployed with your application
Upgrade your old mysql database to your latest mysql database structure
*/
$obj->upgrade();
`
$obj->make();`
all time you when you release new application version with change database structureFiles |
File | Role | Description | ||
---|---|---|---|---|
.github (2 files) | ||||
src (5 files) | ||||
.htaccess | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE.txt | Lic. | License | ||
README.md | Doc. | Documentation |
Files | / | .github |
File | Role | Description |
---|---|---|
ISSUE_TEMPLATE.md | Data | Auxiliary data |
kdbv.png | Data | Auxiliary data |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.