mike-sorokin/migration
Composer 安装命令:
composer require mike-sorokin/migration
包简介
Migration generator for Phinx
关键字:
README 文档
README
Migrations Builder for Phinx.
Currently Phinx (a migration library) cannot generate migrations automatically. Phinx "only" generates a empty class with up and down functions. You still have to write the migration manually.
In reality, you should rarely need to write migrations manually, as the migrations library "should" generate migration classes automatically by comparing your schema mapping information (i.e. what your database should look like) with your actual current database structure.
Generated migration
THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!
Features
- Framework independent
- DBMS: MySQL
- Database: character set, collation
- Tables: create, update, remove, engine, comment, character set, collation
- Columns: create, update, remove
- Indexes: create, remove
- Foreign keys (experimental): create, remove
Not supported
- MySQL [double] is not supported by phinx cakephp/phinx#498
- MySQL [year] is not supported by phinx. cakephp/phinx#704 | cakephp/phinx#551
- MySQL [bit] is not supported by phinx. cakephp/phinx#778
- MySQL enum values with special characters: cakephp/phinx#887
- Migration of contraint names (currently only auto generated): cakephp/phinx#823
- MySQL comments with special characters.
Installation
git clone https://github.com/odan/migrations.git
cd migrations
composer install --no-dev
Integration
composer require odan/migrations
Configuration
- Default configuration file: migrations-config.php
Example:
<?php return array( 'dsn' => 'mysql:host=127.0.0.1;dbname=test', 'username' => 'root', 'password' => '', 'options' => array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', ), 'schema_file' => __DIR__ . '/schema.php', 'migration_path' => __DIR__ );
| Name | Type | Default | Description |
|---|---|---|---|
| dsn | string | Data source name (mysql:host=127.0.0.1;dbname=test) | |
| username | string | Database username | |
| password | string | Database password | |
| options | array | Database options | |
| schema_file | string | schema.php | Database schema file (schema.php or schema.json) |
| migration_path | string | Output directory for migration files |
Usage
Generating migrations
cd bin
php migrations.php migration:generate
Load custom config file
php migrations.php migration:generate --config=myconfig.php
mike-sorokin/migration 适用场景与选型建议
mike-sorokin/migration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 09 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「migration」 「phinx」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mike-sorokin/migration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mike-sorokin/migration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mike-sorokin/migration 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Phinx makes it ridiculously easy to manage the database migrations for your PHP app.
Store your language lines in the database, yaml or other sources
Very simple SQL-based database migrations tool - a heavily stripped down fork of robmorgan/phinx
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Lets you add foreign keys in a swift! Foreign key adder in laravel migration.
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-14

