M:N Relation problem with junction table

Topics: General
Jul 10, 2013 at 9:17 AM
Hey guys, I have a problem wit my M:N relation. I follow the Orchard Relation tutorial see here Building an N-N Relationship.

The Tutorial working fine, but I want to add a field in junction table for ordering the items for every relation. The problem is, if I add a new field into the junction tabel, Orchard give me an error by saving the content : query can not execute ! Is it not possible to add another field into junction tabel ?

thx, for helping

Migration:
 SchemaBuilder.CreateTable("SlideshowPicturePickerHolder",
               table => table
                 .Column<int>("Id", column => column.PrimaryKey().Identity())
                 .Column<int>("Order", column => column.Nullable())
                 .Column<int>("SlideshowPicturePartRecord_Id")
                 .Column<int>("SlideshowPicturePickerPartRecord_Id")
           );
My junction table:
public class SlideshowPicturePickerHolder {
        public virtual int Id { get; set; }
        public virtual int Order { get; set; }
        public virtual SlideshowPicturePartRecord SlideshowPicturePartRecord { get; set; }
        public virtual SlideshowPicturePickerPartRecord SlideshowPicturePickerPartRecord { get; set; }
    }
Jul 10, 2013 at 12:52 PM
Okay I found the Error, Mssql or Orchard dont like the column name 'Order' ...

thx for reading !
Developer
Jul 10, 2013 at 1:00 PM
Yes, try to avoid using special keywords as column names. Order, User, Group etc. will run you into trouble.