我正在使用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.
更多推荐
发布评论