问题标签 [fluent-migrator]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
fluent-migrator - 是否可以将列默认设置为 SQL Server 的 NewId()?
在 fluentMigrator 中,是否可以将列默认设置为函数?
具体来说,我正在向已经包含数据的 SQL Server 2008 表中添加一个 uniqueidentifier (Guid) 列,这将是一个必填字段 - 是否可以将默认值设置为 NewId() 函数?
c# - 是否可以在 application_start 中使用流利的迁移器?
我正在使用流利的迁移器来管理我的数据库迁移,但我想做的是让迁移在应用程序启动时运行。我管理的最接近的是:
我确定我有这个工作,但我有一段时间没有看过它(爱好项目),现在它在上Execute
线时抛出空引用异常。可悲的是,没有这方面的文档,而且我多年来一直在努力解决这个问题。
有没有人设法让这种事情与 FluentMigrator 一起工作?
fluent-migrator - 可以在迁移中添加级联删除规则吗?
在 FluentMigrator 迁移中,如果我要定义关系,请说:
有没有办法定义它们之间的级联删除类型的关系?例如,如果您从 MainTable 中删除某些内容,是否还会删除任何相关记录?
.net - FluentMigrator.Runner 在输出目录中复制 32 位程序集
我有一个引用 FluentMigrator.Runner 的迁移项目。此程序集引用 System.Data.SQLite.dll 的 32 位版本。因此,如果我将此项目部署到我们的 64 位服务器上,则会出现异常:
试图加载格式不正确的程序。
我什至不需要 SQLite,如果我删除解决方案中的每个 System.Data.SQLite.dll 一切正常。但我正在寻找更好的方法来解决这个问题......因为如果 FluentMigrator 更新,我将再次拥有这个 32 位程序集。
有没有办法告诉 Visual Studio 不要将此间接引用的程序集复制到输出目录?还是有比删除所有不需要的 dll 更好的解决方案?
编辑:我正在使用 FluentMigrator 的最新 Nuget 包(1.0.1.0)
Edit2:我从 FluentMigrator.Tools NuGet-Package 中引用了 FluentMigrator.Runner.dll 的 AnyCPU 版本,因为 FluentMigrator-Package 中的 FluentMigrator.Runner.dll 也只有 32 位。但我的问题是 System.Data.SQLite.dll 是 32 位版本。FluentMigrator.Tools 包的 AnyCPU 文件夹中还有另一个 System.Data.SQLite.dll,但是这个 DLL 是二进制等于 32 位版本的(为什么??)...
c# - 在 Fluent Migrator 中回滚到以前的版本
我正在尝试使用流利的迁移器使迁移与我的项目一起工作。但是由于缺乏文档,我正在努力弄清楚如何回滚并Down
为我的迁移类调用该方法。
我使用初始版本 1 类设置了数据库:
我正在通过包含以下内容的批处理文件运行迁移:
"....\tools\fluentmigrator\migrate.exe" --connection "数据源=.\sqlexpress;初始目录=ekmDomains;集成安全=true;multipleactiveresultsets=true;" --db SqlServer2005 --target "bin\Release\EkmDomains.Migrations.dll"
这工作正常。所以我写了第二个迁移类来测试它:
再次运行批处理文件后,一切正常。然后我查看了 fluent 迁移器工具的命令行选项,并看到了一个--version
选项。我假设要回滚到以前的版本,我只需提供--version 1
并调用Down
of 。AddNewTable
然而,这并没有发生。控制台只显示一个“提交事务”方法,然后关闭。但是表并没有被删除,版本号也没有改变。
我这样做是不是错误的方式,或者任何人都可以看到我这样做的一些根本缺陷吗?
version-control - 如何在版本控制下获得大型遗留数据库
我有一个继承的大型遗留项目,其中没有数据库的版本控制。我想创建流畅的迁移并将它们置于源代码控制之下,以便将来管理它。
我的问题是这个项目很大。它包含 6 个独立的数据库。每个数据库都包含大量的业务逻辑。约 120,000 个存储过程、触发器和视图。这太多了,不能手工完成。
有什么方法可以生成从空数据库到生产快照的流畅迁移?
c# - 使用 FluentMigrator 添加代码和状态值的最佳实践?
我们正在开发一个使用 Entity Framework 4(代码优先)和 Fluent Migrator 的项目。
在整个项目过程中,我们为我们希望在各种环境中填充的测试数据创建了所有架构更改和配置文件的迁移。
但是,插入我们希望在所有环境中填充的“代码”和/或“状态”的最佳实践是什么?我们应该在创建表的过程中指定它们还是应该为它们创建一个特定的配置文件?
更具体地说,我们有一个为我们的数据库定义的地址类型的“代码”表,如下所示:
那么,我们是否应该利用这个机会也用我们的数据填充 AddressTypes 表?或者我们应该将其抽象为某种形式的配置文件?
我看到了两者的优点和缺点,所以我很想听听其他团队是如何处理这种情况的。
.net - 是否可以使用 FluentMigrator 创建触发器?
是否可以使用 FluentMigrator 创建触发器,而不使用原始 SQL?
我查看了当前在 Nuget (FluentMigrator.1.0.1.0) 上发布的版本的对象模型,但看不到这样做的方法。
database-migration - Database versions deployment. Entity Framework Migrations vs SSDT DacPacs
I have a data-centered application with SQL Server. The environments in which it´ll be deployed are not under our control and there´s no DBA in there (they are all small businesses) so we need the process of distribution of each application/database update to be as automatic as possible.
Besides of the normal changes between versions of an application (kind of unpredictable sometimes), we already know that we´ll need to distribute some new seed data with each version. Sometimes this seed data will be related to other data in our system. For instance: maybe we´ll need to insert 2 new rows of some master data during the v2-v3 update process, and some other 5 rows during the v5-v6 update process.
EF
We have checked Entity Framework Db Migrations (available for existing databases with no Code-First since 4.3.1 release), which represents the traditional sequential scripts in a more automatic and controlled way (like Fluent Migrations).
SSDT
On the other hand, with a different philosophy, we have checked SSDT and its dacpacs, snapshots and pre- and post-deployment scripts.
The questions are:
Which of these technologies / philosophies is more appropriate for the case described?
Any other technology / philosophy that could be used?
Any other advice?
Thanks in advance.