Skip to content

Commit

Permalink
[BUGFIX] Fix unique_together for Exporter #267
Browse files Browse the repository at this point in the history
  • Loading branch information
kfdm authored Mar 31, 2020
2 parents b71e71d + f23bf59 commit f83e51f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions promgen/migrations/0020_fix_exporter_constraints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.10 on 2020-03-31 05:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('promgen', '0019_sender_enabled'),
]

operations = [
migrations.AlterUniqueTogether(
name='exporter',
unique_together={('job', 'port', 'path', 'scheme', 'project')},
),
]
2 changes: 1 addition & 1 deletion promgen/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class Exporter(BaseExporter):

class Meta:
ordering = ["job", "port"]
unique_together = (("job", "port", "path"),)
unique_together = (("job", "port", "path", "scheme", "project"),)

def __str__(self):
return "{}:{}{}".format(self.job, self.port, self.path or "/metrics")
Expand Down

0 comments on commit f83e51f

Please sign in to comment.