定制 mike-sorokin/migration 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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.

Screenshot

Generated migration

Screenshot 2

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

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

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 46
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固