@@ -0,0 +1,603 @@
+# coding=utf-8%0A%22%22%22fix valuesetref unique%0A%0ARevision ID: 453449671748%0ARevises: 98f845a5742%0ACreate Date: 2015-01-13 18:19:45.110000%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '453449671748'%0Adown_revision = '98f845a5742'%0A%0Aimport datetime%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0A%0A%0Adef upgrade():%0A    op.execute(sa.text('DELETE FROM valuesetreference '%0A        'WHERE pk IN (SELECT pk FROM (SELECT pk, row_number() OVER '%0A            '(PARTITION BY valueset_pk, source_pk ORDER BY pk) AS rnum '%0A            'FROM valuesetreference) AS p WHERE p.rnum %3E 1)'))%0A%0A%0Adef downgrade():%0A    pass%0A

fix valuesetreference duplicate assocs