使用 OrmLite,有没有办法在修改我的 POCO 时自动更新表架构?

使用 OrmLite,有没有办法在修改我的 POCO 时自动更新表架构?

问题描述:

OrmLite 能否识别我的 POCO 和我的架构之间的差异,并根据需要自动添加(或删除)列以强制架构与我的 POCO 保持同步?

Can OrmLite recognize differences between my POCO and my schema and automatically add (or remove) columns as necessary to force the schema to remain in sync with my POCO?

如果这种能力不存在,有没有办法让我查询表模式的数据库,以便我可以手动执行同步?我找到了 this,但我使用随 ServiceStack 一起安装的 OrmLite 版本,在我的一生中,我找不到包含 TableInfo 类的命名空间.

If this ability doesn't exist, is there way for me to query the db for table schema so that I may manually perform the syncing? I found this, but I'm using the version of OrmLite that installs with ServiceStack and for the life of me, I cannot find a namespace that has the TableInfo classes.

目前不支持 ServiceStack 的 OrmLite.

目前在OrmLite 的问题中讨论了一些正在探索的线程添加此内容的不同方法.

There are currently a few threads being discussed in OrmLite's issues that are exploring the different ways to add this.