0

次のエラーを修正するにはどうすればよいですか?エラーがあるため、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

2つの列は、私のモジュールのTaxonomyCatalogPartRecord用に作成されていません。モジュールの移行が正しく実行されなかったようです。

移行には次の方法があります。

  1. 「Create()」は5を返します
  2. 「UpdateFrom5()」は8を返します
  3. 「UpdateFrom8()」は9を返します
  4. 「UpdateFrom9()」は10を返します

テーブルはCreate()で作成されます。

SchemaBuilder.CreateTable(
                "TaxonomyCatalogPartRecord",
                table =>
                table
                    .ContentPartRecord()
                    .Column<string>("General", c => c.Unlimited())
                    .Column<string>("Reproduction", c => c.Unlimited())
                    .Column<string>("Identification", c => c.Unlimited())
                    .Column<string>("Culture", c => c.Unlimited())
                );

2つの列は、次のコードを使用してUpdateFrom9()に追加されます。

SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => {
                t.AddColumn<string>("Evolution");
                t.AddColumn<string>("Morphology");
            });

また、SpecFlowの実行中に次のエラーが発生しました。

  NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: SELECT this_.Id as Id11_0_, this_.SerialNumber as SerialNu2_11_0_ FROM Settings_ShellDescriptorRecord this_ WHERE 1=1
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Settings_ShellDescriptorRecord ]
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Settings_ShellDescriptorRecord ]

そして、次のとおりです。

 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
4

1 に答える 1

0

次のように、AlterTableメソッドをAlterTableメソッドの2つの別々の呼び出しに変更します。

   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")
            });

しかし、それについてはよくわかりません。幸運を

于 2012-09-01T15:03:18.447 に答える