Skip to content

Commit

Permalink
add better comments
Browse files Browse the repository at this point in the history
add whois related cols
  • Loading branch information
wedamija committed Aug 28, 2024
1 parent d75f648 commit 0029ce9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
34 changes: 31 additions & 3 deletions src/sentry/uptime/migrations/0008_uptime_url_suffix.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,28 @@ class Migration(CheckedMigration):
),
migrations.RunSQL(
"""
ALTER TABLE "uptime_uptimesubscription" ADD COLUMN "url_suffix" character varying(255) NOT NULL DEFAULT '';
ALTER TABLE "uptime_uptimesubscription" ADD COLUMN "url_domain_suffix" character varying(255) NOT NULL DEFAULT '';
""",
reverse_sql="""
ALTER TABLE "uptime_uptimesubscription" DROP COLUMN "url_suffix";
ALTER TABLE "uptime_uptimesubscription" DROP COLUMN "url_domain_suffix";
""",
hints={"tables": ["uptime_uptimesubscription"]},
),
migrations.RunSQL(
"""
ALTER TABLE "uptime_uptimesubscription" ADD COLUMN "host_whois_orgname" character varying(255) NOT NULL DEFAULT '';
""",
reverse_sql="""
ALTER TABLE "uptime_uptimesubscription" DROP COLUMN "host_whois_orgname";
""",
hints={"tables": ["uptime_uptimesubscription"]},
),
migrations.RunSQL(
"""
ALTER TABLE "uptime_uptimesubscription" ADD COLUMN "host_whois_orgid" character varying(255) NOT NULL DEFAULT '';
""",
reverse_sql="""
ALTER TABLE "uptime_uptimesubscription" DROP COLUMN "host_whois_orgid";
""",
hints={"tables": ["uptime_uptimesubscription"]},
),
Expand All @@ -54,7 +72,17 @@ class Migration(CheckedMigration):
),
migrations.AddField(
model_name="uptimesubscription",
name="url_suffix",
name="url_domain_suffix",
field=models.CharField(db_index=True, default="", max_length=255),
),
migrations.AddField(
model_name="uptimesubscription",
name="host_whois_orgname",
field=models.CharField(db_index=True, default="", max_length=255),
),
migrations.AddField(
model_name="uptimesubscription",
name="host_whois_orgid",
field=models.CharField(db_index=True, default="", max_length=255),
),
],
Expand Down
9 changes: 7 additions & 2 deletions src/sentry/uptime/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ class UptimeSubscription(BaseRemoteSubscription, DefaultFieldsModel):
url = models.CharField(max_length=255)
# The domain of the url, extracted via TLDExtract
url_domain = models.CharField(max_length=255, db_index=True, default="")
# The suffix of the url, extracted via TLDExtract
url_suffix = models.CharField(max_length=255, db_index=True, default="")
# The suffix of the url, extracted via TLDExtract. This can be a public suffix, such as .com, .gov.uk, .com.au, or
# a private suffix, such as vercel.dev
url_domain_suffix = models.CharField(max_length=255, db_index=True, default="")
# Org name of the host of the url
host_whois_orgname = models.CharField(max_length=255, db_index=True, default="")
# Org id of the host of the url
host_whois_orgid = models.CharField(max_length=255, db_index=True, default="")
# How frequently to run the check in seconds
interval_seconds = models.IntegerField()
# How long to wait for a response from the url before we assume a timeout
Expand Down

0 comments on commit 0029ce9

Please sign in to comment.