id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,parents 550,Fix missing constraint in recent migrations,Christopher Allan Webber,Elrond,"A recent migration added a table for the CollectionItem model but didn't add the constraint of: {{{ __table_args__ = ( UniqueConstraint('collection', 'media_entry'), {}) }}} Since then we've moved to a new style of ""creating models in migrations"" which involves actually putting a copy of the original model inside the migrations file to make it easier to create the right database. However, anyone running from git master will currently pick up the ""mistaken"" commit. There basically seem to be one of two possible solutions: * One, try to create a migration that's ""smart""-ish. We can't check for constraints... sqlalchemy doesn't have support for that... but we could maybe try adding the constraint and just catch the exception if it isn't allowed? * That might not work though (and it does feel a bit ""icky""). If it doesn't, we should simply correct the old migration and also create scripts that will add the constraint for people who may have picked up the bad migration from git master.",defect,closed,blocker,0.3.2,programming,fixed,,Elrond,