如何删除Propel ORM ver中的列。(How can I remove column in Propel ORM ver. 1.3?)

编程入门 行业动态 更新时间:2024-10-27 06:26:50
如何删除Propel ORM ver中的列。(How can I remove column in Propel ORM ver. 1.3?)

我正在使用Symfony和Propel ORM v.1.3。 我需要在任务中更改表模式,准确删除几列。 我怎样才能做到这一点? 我在TableMap类中看到了方法addColumn,但是没有removeColumn或deleteColumn方法。

I'm using Symfony with Propel ORM v.1.3. I need to change table schema in task, remove few columns exactly. How can I do that? I saw method addColumn in TableMap class, but there was no removeColumn or deleteColumn method.

最满意答案

如果要删除列,则必须更改schema.xml ,然后迁移数据库 。

恕我直言Propel ORM不是以编程方式添加或删除列。 TableMap类中的addColumn函数也不是。 因此,如果您的任务以某种方式自动执行上述迁移文档中描述的步骤,那将是最好的。

If you want to remove a column you have to change the schema.xml and then migrate your database.

IMHO the Propel ORM isn't designed to add or remove columns programmatically. The addColumn function in the TableMap class isn't either. So it would be best if your task would somehow automate the steps described in the above mentioned documentation for migrations.

更多推荐

本文发布于:2023-07-24 19:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1250214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ver   ORM   Propel   column   remove

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!