websupply/doctrine-rollback
Composer 安装命令:
composer require websupply/doctrine-rollback
包简介
README 文档
README
Rollback the latest executed Doctrine migration by running
./flow doctrine:rollback
Installation
composer require websupply/doctrine-rollback
How can this package help you?
Did you execute a database migration while developing, and want to run the down (rollback) direction, the command looks as such
./flow doctrine:migrationexecute --version <your-migration-version> --direction down
With this package, you can run
./flow doctrine:rollback
And the latest applied migration, will be executed with the down direction
Dry run
By setting the --dry-run argument, the command will outpt what version it was meant to execute, but not actually execute it
Example output
This output, is based on running the migrations from Flows base distribution
$ ./flow doctrine:migrate
[HERE COMES ALL THE MIGRATION EXECUTED]
[warning] Migration Neos\Flow\Persistence\Doctrine\Migrations\Version20150611154419 was executed but did not result in any SQL statements.
[notice] finished in 2001.8ms, used 24M memory, 27 migrations executed, 94 sql queries
Now we are setup
$ ./flow doctrine:rollback --dry-run
DRY RUN: Rollback migration "Neos\Flow\Persistence\Doctrine\Migrations\Version20200908155620"
A dry run, telling us that version 20200908155620 will be the one to rollback
$ ./flow doctrine:rollback
Migrating down to Neos\Flow\Persistence\Doctrine\Migrations\Version20200908155620
-> ALTER TABLE neos_flow_resourcemanagement_persistentresource ADD md5 VARCHAR(32) NOT NULL
[notice] finished in 151.7ms, used 24M memory, 1 migrations executed, 1 sql queries
Executing the rollback, rolling back the migration expected
$ ./flow doctrine:migrate
Migrating up to Neos\Flow\Persistence\Doctrine\Migrations\Version20200908155620
-> ALTER TABLE neos_flow_resourcemanagement_persistentresource DROP md5
[notice] finished in 204.9ms, used 22M memory, 1 migrations executed, 1 sql queries
And running the doctrine:migrate command again, to re-apply it (imagine, that you changed something in your migration)
Support and sponsoring
Work on this package is supported by the danish web company WebSupply ApS
websupply/doctrine-rollback 适用场景与选型建议
websupply/doctrine-rollback 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 47 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 websupply/doctrine-rollback 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 websupply/doctrine-rollback 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-02-06