ganeshkandu/kdbv
Composer 安装命令:
composer require ganeshkandu/kdbv
包简介
mysql database auto schema migration tool
关键字:
README 文档
README
how it works
kdbvis Compare the structure of old database and latest database structure and make required queries to migrate old database
- Create
kdbvdatabase- dbv database is a single file witch contains database structure
- its created using
makefunction
upgradefunction is Compare the contents of your old databases withkdbvfile ( witch contains latest database structure ) and Automate your data migrations from old to latest- using
queryfunction you can get all sql queries. that need to migrate database- its return array of queries
Give star to library if you like STAR++
Features
- Upgrade - Database Upgrade
- Easy - Extremely easy to learn and use
Requirement
PHP 5.3+ and PDO extension installed
Get Started
Installation
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
or
To add in in your dependencies
php composer.phar require ganeshkandu/kdbv
Auto loading
This library requires an autoloader, if you aren't already using one you can include Composers autoloader.
require('vendor/autoload.php');
Usage
steps to perform
- Create
kdbv databaseusingmakefunction of yourlatest database - deploy
kdbv databasewith your application - You can simply overwrite latest version of your application on your old version of application ( NOTES latest version is deployed with
kdbv databaseandkdbv library) - now you have your latest changed files with your old database which need to be update to new changes database structure
- now
upgradeyour database usingupgradefunction - ALL DONE ENJOY
- if you getting any issue create an issue
step 1
Instantiate & load()
// 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 ofkdbv databasewhich to be deploy with your application ( kdbv database contain database structure of your latest application )
step 2
use
$objof step 1
create 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();
step 3
use
$objof step 1
Get Mysql Upgrade Queries
$sqls_queries = $obj->query(); foreach($sqls_queries as $query){ echo $query."\n"; }
or
Upgrade mysql database
/* 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();
Best practices
- run
$obj->make();all time you when you release new application version with change database structure
Maintainers
ganeshkandu/kdbv 适用场景与选型建议
ganeshkandu/kdbv 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 316 次下载、GitHub Stars 达 9, 最近一次更新时间为 2017 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「php」 「data」 「mysql」 「schema」 「composer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ganeshkandu/kdbv 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ganeshkandu/kdbv 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ganeshkandu/kdbv 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
Adds the EDTF data type to Wikibase
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
A simple library that allows transform any kind of data to native php data or whatever
统计信息
- 总下载量: 316
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2017-12-02
