sunnyflail/doctrine-migration-schema-updater
Composer 安装命令:
composer require sunnyflail/doctrine-migration-schema-updater
包简介
Simple doctrine migrations overrider
README 文档
README
This package provides a flexible way to introduce custom schema generation logic that integrates seamlessly with the doctrine:migrations:diff command.
Custom changes applied through this mechanism will persist across schema updates, ensuring your modifications are retained automatically.
Symfony Integration
1. Register the Bundle
Add the bundle to your config/bundles.php file:
SunnyFlail\DoctrineMigrationSchemaUpdater\Symfony\DoctrineSchemaUpdaterBundle::class => ['dev' => true],
Once registered, the bundle is active — but note that it does not alter your schema by default.
2. Default Schema Updater
The bundle includes one built-in schema updater:
SunnyFlail\DoctrineMigrationSchemaUpdater\SchemaUpdater\EmbeddableSchemaUpdater
This updater is automatically available for dependency injection but requires additional configuration to function properly.
If you want to modify the schema generated for entities containing embedded objects, implement the following interface:
SunnyFlail\DoctrineMigrationSchemaUpdater\SchemaUpdater\UpdateEmbeddableSchemaInterface
Then, register your service and tag it as follows:
tags: - { name: 'doctrine.migrations.schema_updater.embeddable_schema_updater' }
3. Implementing Custom Schema Updaters
For more advanced schema modification logic, you can create your own schema updater by implementing:
SunnyFlail\DoctrineMigrationSchemaUpdater\SchemaUpdater\SchemaUpdaterInterface
and tagging it as:
tags: - { name: 'doctrine.migrations.schema_updater.schema_updater' }
This allows you to define complex schema transformations that will be automatically included in the Doctrine migration diff.
4. Further Configuration
For detailed configuration options and customization possibilities, refer to the compiler pass and bundle configuration
services.yaml
✅ Summary:
- Integrates with Doctrine’s migration diff process.
- Preserves custom schema changes across migrations.
- Easily extendable via tagged schema updaters.
sunnyflail/doctrine-migration-schema-updater 适用场景与选型建议
sunnyflail/doctrine-migration-schema-updater 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sunnyflail/doctrine-migration-schema-updater 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sunnyflail/doctrine-migration-schema-updater 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-23