Skip to content

Commit

Permalink
Fix noderequest uniqueness by adding back RunSQL calls
Browse files Browse the repository at this point in the history
Note: this is a temporary commit to pass CI only. The change
      in this commit will be included in another PR or commit
      that should aggregate all RunSQL calls for indexes.
  • Loading branch information
cslzchen committed Aug 18, 2022
1 parent a54bbbe commit fcff72a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions osf/migrations/0003_aggregated_runsql_calls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('osf', '0002_adminlogentry'),
]

operations = [
migrations.RunSQL(
[
"""
CREATE UNIQUE INDEX osf_noderequest_target_creator_non_accepted ON osf_noderequest (target_id, creator_id)
WHERE machine_state != 'accepted';
"""
], [
"""
DROP INDEX IF EXISTS osf_noderequest_target_creator_non_accepted RESTRICT;
"""
]
),
]

0 comments on commit fcff72a

Please sign in to comment.