Download the PHP package webman-micro/migrations without Composer

On this page you can find all versions of the php package webman-micro/migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package migrations

webman-micro/migrations

包装 robmorgan/phinx 组件支持webman命令行

说明

Phinx 可以让开发者简洁的修改和维护数据库。 它避免了人为的手写 SQL 语句,它使用强大的 PHP API 去管理数据库迁移。开发者可以使用版本控制管理他们的数据库迁移。 Phinx 可以方便的进行不同数据库之间数据迁移。还可以追踪到哪些迁移脚本被执行,开发者可以不再担心数据库的状态从而更加关注如何编写出更好的系统。

项目地址

https://github.com/webman-micro/migrations

安装

通过composer安装

官方中文文档地址

详细使用可以去看官方中文文档,这里只讲怎么在webman中配置使用

https://tsy12321.gitbooks.io/phinx-doc/content/

配置说明

主配置信息

迁移文件目录结构

命令行说明

migrations 迁移文件命令

命令 说明
php webman migrations:breakpoint 设置断点
php webman migrations:create 创建迁移脚本文件
php webman migrations:list_aliases 列出模板类别名
php webman migrations:migrate 运行执行所有脚本
php webman migrations:rollback 回滚之前的迁移脚本,与 Migrate 命令相反
php webman migrations:status 打印所有迁移脚本和他们的状态
php webman migrations:test 验证配置文件

Breakpoint 命令

Breakpoint 命令用来设置断点,可以使你对回滚进行限制。你可以调用 breakpoint 命令不带任何参数,即将断点设在最新的迁移脚本上

可以使用 --target 或者 -t 来指定断点打到哪个迁移版本上

可以使用 --remove-all 或者-r 来移除所有断点

当你运行 status 命令时可以看到断点信息

Create 命令

create 命令用来创建迁移脚本文件。需要一个参数:脚本名。迁移脚本命名应该保持 驼峰命名法

打开新创建的迁移脚本并编写数据库修改。Phinx 把迁移脚本创建到 phinx.yml 里面指定的路径。更多信息参考 配置

你可以重写模板文件,并在创建的时候指定模板

可以提供一个模板类,这个类必须继承接口 Phinx\Migration\CreationInterface

提供的模板中,类中也可以定义回调,这个回调将在迁移脚本生成的时候被调用

注意:你不能同时使用 --template--class

Migrate 命令

Migrate 命令默认运行执行所有脚本,可选指定环境

可以使用 --target 或者 -t 来指定执行某个迁移脚本

Rollback 命令

Rollback 命令用来回滚之前的迁移脚本。与 Migrate 命令相反。

你可以使用 rollback 命令回滚上一个迁移脚本。不带任何参数

使用 --target 或者 -t 回滚指定版本迁移脚本

指定版本如果设置为0则回滚所有脚本

可以使用 --date 或者 -d 参数回滚指定日期的脚本

如果断点阻塞了回滚,你可以使用 --force 或者-f参数强制回滚

Status 命令

Status 命令可以打印所有迁移脚本和他们的状态。你可以用这个命令来看哪些脚本被运行过了

当所有脚本都已经执行(up)该命令将退出并返回 0

Seed 数据填充文件命令

命令 说明
php webman seed:create 创建 seed 类
php webman seed:run 执行所有 seed

Seed Create 命令

Seed Create 命令可以被用来创建 seed 类。需要一个类名参数。命名格式使用驼峰法。

Seed Run 命令

默认Seed run 命令会执行所有 seed。

如果你想要指定执行一个,只要增加 -s 参数并接 seed 的名字


All versions of migrations with dependencies

PHP Build Version
Package Version
Requires robmorgan/phinx Version ^0.16.0
php Version >=8.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webman-micro/migrations contains the following files

Loading the files please wait ....