我从nuget安装了最新的DbUp版本4.4.0,并遵循了文档中描述的步骤
https://dbup.readthedocs.io/en/latest/
我正在使用MySQL数据库,并创建了一个新的.NET核心控制台项目。
。
静态虚主( "Server=localhost;Port=3306;Database=my_database;Uid=root;Pwd=admin;";args) { var connectionString = DeployChanges.To .MySqlDatabase(connectionString) .WithScriptsEmbeddedInAssembly(Assembly.GetExecutingAssembly()) .Build();var connectionString=upgrader.PerformUpgrade()如果(!result.Successful) {抛出result.Error;}
我在该项目中创建了一个新的resource文件,并将其命名为1595961596-_script.sql,并将其定义为一个嵌入式.sql
。
DROP DATABASE IF EXISTS `my_database`;
CREATE DATABASE `my_database`;result.Successful时返回false并引发此错误表'my_database.schemaversions‘不存在
我认为它会自动生成schemaversions表吗?有人知道怎么修吗?
如果有帮助的话:我在MariaDb中使用Linux。我还尝试用我自己的方式创建那个表。
https://dbup.readthedocs.io/en/latest/more-info/journaling/
.JournalToSqlTable("my_database", "schemaversions")但是我得到了这个错误
MySql.Data.MySqlClient.MySqlException:您的SQL语法出现了错误;请检查与MariaDB服务器版本对应的手册,以获得在第1行my_database.schemaversions( identity(1,1) null约束)附近使用的正确语法。
发布于 2021-03-11 16:41:28
我来这里是因为我看到了这个错误..。除了在我的例子中,它似乎与这个旧的bug有某种联系:https://github.com/DbUp/DbUp/issues/188。另一个模式已经有了一个schemaversions表。
https://stackoverflow.com/questions/63220911
复制相似问题