[Buildbot-commits] [Buildbot] #2423: sqlalchemy IntegrityError: insert on table "buildsets" violates foreign key constraint "buildsets_sourcestampid_fkey"

Buildbot nobody at buildbot.net
Wed Jan 9 04:26:59 UTC 2013


#2423: sqlalchemy IntegrityError: insert on table "buildsets" violates foreign key
constraint "buildsets_sourcestampid_fkey"
-----------------------+---------------------
Reporter:  jaredgrubb  |       Owner:
    Type:  defect      |      Status:  closed
Priority:  major       |   Milestone:  0.9.0
 Version:  master      |  Resolution:  fixed
Keywords:              |
-----------------------+---------------------
Changes (by dustin):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:  undecided => 0.9.0


Comment:

 Stupid Akismet.  If you link to a pastebin I can edit the Trac comment
 afterward and add the pastebin comments.  Next time..

 I'm assuming this is using Postgres, based on the error message.

 Oh!  I know what this is.  In 'nine' I noticed that the way the migration
 to sourcestampsets works, buildsets ends up with a foreign key reference
 from buildsets.sourcestampid to *both* sourcestamps.id *and*
 sourcestampsets.id.  I've fixed this in the 9/sourcestamps branch (as part
 of a much larger refactor).

 For your case, I suspect you could simply drop the bogus
 buildset_sourcestamps_fkey.  IIRC that looks like

 {{{
 ALTER TABLE buildsets drop foreign key buildset_sourcestamps_fkey
 }}}

 I don't think this is worth its own migration script (although I may
 change my mind if others run into the same thing).

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2423#comment:2>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list