The ALTER TABLE statement conflicted with the FOREIGN KEY constraint

2 posts, 0 answers
  1. Stephen
    Stephen avatar
    1 posts
    Member since:
    Oct 2011

    Posted 07 Mar 2012 Link to this post

    We upgraded from sitefinity 4.3 to 4.4 and i get an error on a custom module that was outsourced


      personConfiguration.HasAssociation(p => p.Functions).WithOpposite(f => f.Persons)
                     .MapJoinTable("PM_Person_Function", (person, function) => new
                     {
                         PM_Person_ID = person.Id,
                         PM_Function_ID = function.Id
                     }).HasSequenceColumn("PM_Person_Function_ID", "Int"); 

    The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "ref_PM_Prsn_Function_PM_Person". The conflict occurred in database "PromaxBDA", table "dbo.PM_Person", column 'PM_Person_ID'.

  2. Stanislav Velikov
    Admin
    Stanislav Velikov avatar
    4 posts

    Posted 12 Mar 2012 Link to this post

    Hello,

     Review the tables created by the custom modules in the database (the error indicates pm_person). The foreign key constraint prevents the table to be updated or deleted. Check if there are any constraints in the Fluent Mapping of the module and check which entry in the database is conflicting with the foreign key. I suppose it is one module item creating the problem.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top