开发者

In symfony 1.4, is there a way to override or extend parts of a generated schema.yml?

We are using symfony 1.4 with doctrine. Because of the nature of our development, the three of us working on this project need to regenerate our schema, model, forms and filters every morning.

I want to keep a table set as "versionable" in the schema. If I re-generate the schema with php symfony doctrine:build-schema, the resulting file does not have the actAs: in it anymore, and I need to copy and paste before re-generating my model, forms and filters.

Is there a way to extend the schema.yml so that we can avoid copying and pasting a snippet of code 开发者_如何转开发every morning to keep that configuration constant? If so, how far do I need to go in the extending file? For example, can I include only the actAs: for that individual table, or do I need to define the table in its entirety?


When you regenerate your model, you only regenerate the base* files. Extending the setup() method contained in the Base* classes in the * classes (you can find them one directory up) might be a solution to add you versionnable behavior permanently. But I think the most handy would be to import modified schema.yml instead of modified tables, unless you don't want to loose your data. Can't you apply a version of your schema.yml only to development machines by using a branch?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜