Orchardcms Orchard SpecFlow测试无法正确运行模块迁移

Orchardcms Orchard SpecFlow测试无法正确运行模块迁移,orchardcms,Orchardcms,如何更正以下错误?出现错误,无法运行SpecFlow测试 NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute command: INSERT INTO ..._TaxonomyCatalogPartRecord (General, Reproduction, Identification, Culture, Evolution, Morphology, Id) VALUES (@p0, @p1, @p2, @p3, @

如何更正以下错误?出现错误,无法运行SpecFlow测试

  NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute command: INSERT INTO ..._TaxonomyCatalogPartRecord (General, Reproduction, Identification, Culture, Evolution, Morphology, Id) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)
  NHibernate.Util.ADOExceptionReporter Error: 0 : The column name is not valid. [ Node name (if any) = ,Column name = Evolution ]
  Orchard.ContentManagement.DefaultContentManager Error: 0 : GenericADOException thrown from IContentHandler by Orchard.Autoroute.Handlers.AutoroutePartHandler
  NHibernate.AssertionFailure Error: 0 : An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types.
  NHibernate.Impl.AbstractSessionImpl Error: 0 : DTC transaction prepre phase failed
这两列不是为模块的TaxonomyCatalogPartRecord创建的。我的模块迁移似乎没有正确运行

迁移有以下方法:

  • “Create()”返回5
  • “UpdateFrom5()”返回8
  • “UpdateFrom8()”返回9
  • “UpdateFrom9()”返回10
  • 该表是在Create()中创建的:

    以及以下各项:

     NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: 
    
      SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, termpartre2_.Id as Id273_3_, termpartre2_.TaxonomyId as TaxonomyId273_3_, termpartre2_.Path as Path273_3_, termpartre2_.Count as Count273_3_, termpartre2_.Selectable as Selectable273_3_, termpartre2_.Weight as Weight273_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ 
    
      FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TermPartRecord termpartre2_ on contentite1_.Id=termpartre2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0
    
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
      Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
      NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, taxonomypa2_.Id as Id272_3_, taxonomypa2_.TermTypeName as TermType2_272_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TaxonomyPartRecord taxonomypa2_ on contentite1_.Id=taxonomypa2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
      Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
    

    将AlterTable方法更改为AlterTable方法的两个单独调用,如下所示:

       SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Evolution")); 
       SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Morphology"));
    
    schemabilder.AlterTable(“TaxonomyCatalogPartRecord”,t=>t.AddColumn(“Evolution”);
    SchemaBuilder.AlterTable(“TaxonomyCatalogPartRecord”,t=>t.AddColumn(“形态学”);
    
    或者您的语法可能是错误的,应该是错误的

    SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => {
                    t.AddColumn<string>("Evolution"),
                    t.AddColumn<string>("Morphology")
                });
    
    schemabilder.AlterTable(“TaxonomyCatalogPartRecord”,t=>{
    t、 AddColumn(“演变”),
    t、 AddColumn(“形态学”)
    });
    

    但我不确定这一点。祝你好运

    SchemaBuilder.AlterTable(“分类CatalogPartRecord”,t=>t.AddColumn(“Evolution”);SchemaBuilder.AlterTable(“TaxonomyCatalogPartRecord”,t=>t.AddColumn(“形态学”);哈扎,这真的很有帮助。非常感谢。为什么这个除法解决了这个错误?我想要么它不允许您同时对一个表进行多次修改,要么可能是您的语法错误,您不应该使用“;”在每个.AddColumn之后,但有一个“,”分隔它们。至少它是有效的,我会把它作为帮助他人的答案
     NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: 
    
      SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, termpartre2_.Id as Id273_3_, termpartre2_.TaxonomyId as TaxonomyId273_3_, termpartre2_.Path as Path273_3_, termpartre2_.Count as Count273_3_, termpartre2_.Selectable as Selectable273_3_, termpartre2_.Weight as Weight273_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ 
    
      FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TermPartRecord termpartre2_ on contentite1_.Id=termpartre2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0
    
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
      Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
      NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, taxonomypa2_.Id as Id272_3_, taxonomypa2_.TermTypeName as TermType2_272_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TaxonomyPartRecord taxonomypa2_ on contentite1_.Id=taxonomypa2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
      NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
      Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
    
       SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Evolution")); 
       SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Morphology"));
    
    SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => {
                    t.AddColumn<string>("Evolution"),
                    t.AddColumn<string>("Morphology")
                });