vladahejda / migrant
该包的最新版本(dev-master)没有可用的许可证信息。
dev-master
2015-02-21 17:25 UTC
Requires
- dg/ftp-deployment: 2.1
This package is not auto-updated.
Last update: 2024-09-14 16:51:11 UTC
README
- 安装
添加到您的 composer.json
"require-dev": { "vladahejda/migrant": "dev-master" }
- 配置
将 [migrant]
部分添加到 dg/ftp-deployment INI 配置文件中
[migrant] ; database DSN ; do not forget that this DSN must have all database rights to execute migration SQLs dsn = <driver>://<username>:<password>@<host>/<database> ; production URL including protocol siteUrl = http://example.com ; comma separated list of IP addresses that can trigger migrations via HTTP allowedIps = ; mail to notify failure of migrations reportingMail = ; remote directory for control files, defaults to root ;storageDir = / ; logs migrations success or failure, defaults to /log/migrant.log ;log = /log/migrant.log ; Directory with the migrations, defaults to /migrations ;migrationsDir = /migrations ; todo ;secretDir = /.secret
- 制作迁移
将一些 SQL 或 PHP 迁移放置到 migrationsDir
目录中。例如,创建一个包含一些表创建的 .sql
文件。
- 触发部署
通过 CLI 运行 php <project-dir>/vendor/vladahejda/migrant/src/migrate <config-file>
。