我怎样才能生成“迁移” NHibernate 映射文件中的 DDL?

发布于 2024-07-05 00:28:05 字数 175 浏览 4 评论 0原文

我在我的项目中使用 NHibernate 2 和 PostgreSQL。 SchemaExport 类在为数据库生成 DDL 方案方面做得很好,但在第一个应用程序之前它就很棒。

有没有办法使用 NHibernate 映射文件生成“迁移”DLL(批量“ALTER TABLE”而不是 DROP/CREATE 对)?

I'm using NHibernate 2 and PostgreSQL in my project. SchemaExport class does a great job generating DDL scheme for database, but it's great until the first application.

Is there any way to generate "migration" DLL (batch of "ALTER TABLE"'s instead of DROP/CREATE pair) using NHibernate mapping files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情愿 2024-07-12 00:28:05

虽然 SchemaUpdate 很好地满足了我的需求,但它仍然存在一些问题。 例如,它拒绝对现有数据库列施加新的限制,即使它不会与现有数据冲突。

我将向前扩展一点 SchemaUpdate,或者如果失败,切换到手动驱动的迁移工具之一(例如 Rails 工具)。

While SchemaUpdate very much answers my needs, it still has several problems. For example it refuses to put a new restriction on existing database column even if it's not gonna conflict with existing data.

I'm going froward to extend SchemaUpdate a little bit or, if fail, switch to one of that hand driven migration tools (for example Rails one).

尬尬 2024-07-12 00:28:05

查看SchemaUpdate。 与 SchemaExport 非常相似的 API,但它只创建迁移。

Look into SchemaUpdate. Very similiar API as SchemaExport but it only creates migrations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文