indigerd/yii2-migration-aware-module 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

indigerd/yii2-migration-aware-module

Composer 安装命令:

composer require indigerd/yii2-migration-aware-module

包简介

Migration aware module extension for Yii2.

README 文档

README

Yii2 extension that allows modules to store migrations in their own folders and make them available for yii/migrate command

##Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require "indigerd/yii2-migration-aware-module" "*"

or add

"indigerd/yii2-migration-aware-module" : "*"

to the require section of your application's composer.json file.

##Usage

In your console config file in your migration section replace with class property and add configFiles array property. configFiles is array of configs where component will scan for your migration aware modules. By default configFiles contains backend and frontend configs from advanced application template. For example:

        'migrate'=>[
            'class' => 'indigerd\migrationaware\controllers\MigrateController',
            'configFiles' => [
                '@backend/config/web.php',
                '@frontend/config/web.php',
                '@someAnotherAliasHere/config/web.php',
            ],
            
            'migrationPath'=>'@common/migrations/db', //leave as it was before
            'migrationTable'=>'{{%system_db_migration}}' //leave as it was before
        ],

In your modules that have migrations your need either to implement indigerd\migrationaware\MigrationAwareInterface or to extend from indigerd\migrationaware\MigrationAwareModule. If you will implement interface you should implement method getMigrationPath and return in it folder which contains your module migrations. For example:

    public function getMigrationPath()
    {
        return __DIR__.'/migrations';
    }

##License

yii2-migration-aware-module is released under the MIT License. See the bundled LICENSE file for details.

统计信息

  • 总下载量: 59.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固