使用 OrmLite,有没有办法在修改我的 POCO 时自动更新表架构? [英] With OrmLite, is there a way to automatically update table schema when my POCO is modified?

查看:33
本文介绍了使用 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.

这篇关于使用 OrmLite,有没有办法在修改我的 POCO 时自动更新表架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆