【问题标题】:How can I use existing database in SERENE Core?如何使用 SERENE Core 中的现有数据库?
【发布时间】:2021-02-13 20:13:51
【问题描述】:

我已经在 SQL Server 2019 express 中有一个数据库,我希望能够在 SERENE 中使用它,我应该怎么做?

【问题讨论】:

  • 只需在表上运行 sergen,无需编写迁移,因为您的数据库已准备就绪

标签: asp.net-core rad serenity-platform


【解决方案1】:

迁移助手检查连接字符串的数据库是否存在。如果是,则不会执行迁移数据。在文件 Datamigrations.cs 的第 205 行中切换此检查:

            if (!isOracle && cs.ConnectionString.IndexOf(typeof(DataMigrations).Namespace +
                    @"_" + databaseKey + "_v1", StringComparison.OrdinalIgnoreCase) < 0)
            {
//                SkippedMigrations = true;
//                return;
            }

【讨论】:

    猜你喜欢
    • 2021-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-21
    • 1970-01-01
    • 2020-06-15
    相关资源
    最近更新 更多