feat(preprod): Create initial preprod snapshots models#106823
Merged
feat(preprod): Create initial preprod snapshots models#106823
Conversation
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Create model PreprodSnapshotMetrics
--
CREATE TABLE "sentry_preprodsnapshotmetrics" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "image_count" integer NOT NULL CHECK ("image_count" >= 0), "extras" jsonb NULL, "preprod_artifact_id" bigint NOT NULL UNIQUE);
--
-- Create model PreprodSnapshotComparison
--
CREATE TABLE "sentry_preprodsnapshotcomparison" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "state" integer NOT NULL CHECK ("state" >= 0), "error_code" integer NULL CHECK ("error_code" >= 0), "error_message" text NULL, "images_added" integer NOT NULL CHECK ("images_added" >= 0), "images_removed" integer NOT NULL CHECK ("images_removed" >= 0), "images_changed" integer NOT NULL CHECK ("images_changed" >= 0), "images_unchanged" integer NOT NULL CHECK ("images_unchanged" >= 0), "images_renamed" integer NOT NULL CHECK ("images_renamed" >= 0), "extras" jsonb NULL, "base_snapshot_metrics_id" bigint NOT NULL, "head_snapshot_metrics_id" bigint NOT NULL);
ALTER TABLE "sentry_preprodsnapshotmetrics" ADD CONSTRAINT "sentry_preprodsnapsh_preprod_artifact_id_848e8caf_fk_sentry_pr" FOREIGN KEY ("preprod_artifact_id") REFERENCES "sentry_preprodartifact" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_preprodsnapshotmetrics" VALIDATE CONSTRAINT "sentry_preprodsnapsh_preprod_artifact_id_848e8caf_fk_sentry_pr";
CREATE UNIQUE INDEX CONCURRENTLY "sentry_preprodsnapshotco_head_snapshot_metrics_id_5e318dcf_uniq" ON "sentry_preprodsnapshotcomparison" ("head_snapshot_metrics_id", "base_snapshot_metrics_id");
ALTER TABLE "sentry_preprodsnapshotcomparison" ADD CONSTRAINT "sentry_preprodsnapshotco_head_snapshot_metrics_id_5e318dcf_uniq" UNIQUE USING INDEX "sentry_preprodsnapshotco_head_snapshot_metrics_id_5e318dcf_uniq";
ALTER TABLE "sentry_preprodsnapshotcomparison" ADD CONSTRAINT "sentry_preprodsnapsh_base_snapshot_metric_4d7d08c0_fk_sentry_pr" FOREIGN KEY ("base_snapshot_metrics_id") REFERENCES "sentry_preprodsnapshotmetrics" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_preprodsnapshotcomparison" VALIDATE CONSTRAINT "sentry_preprodsnapsh_base_snapshot_metric_4d7d08c0_fk_sentry_pr";
ALTER TABLE "sentry_preprodsnapshotcomparison" ADD CONSTRAINT "sentry_preprodsnapsh_head_snapshot_metric_a2fe43bf_fk_sentry_pr" FOREIGN KEY ("head_snapshot_metrics_id") REFERENCES "sentry_preprodsnapshotmetrics" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_preprodsnapshotcomparison" VALIDATE CONSTRAINT "sentry_preprodsnapsh_head_snapshot_metric_a2fe43bf_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "sentry_preprodsnapshotcomp_base_snapshot_metrics_id_4d7d08c0" ON "sentry_preprodsnapshotcomparison" ("base_snapshot_metrics_id");
CREATE INDEX CONCURRENTLY "sentry_preprodsnapshotcomp_head_snapshot_metrics_id_a2fe43bf" ON "sentry_preprodsnapshotcomparison" ("head_snapshot_metrics_id"); |
NicoHinderling
approved these changes
Jan 23, 2026
noahsmartin
reviewed
Jan 23, 2026
noahsmartin
reviewed
Jan 23, 2026
trevor-e
approved these changes
Jan 23, 2026
263f5e6 to
295179a
Compare
295179a to
cdce9e3
Compare
JonasBa
pushed a commit
that referenced
this pull request
Jan 27, 2026
Creates new snapshots DB models for upcoming Emerge snapshots integration. Nested in a `/snapshots` folder to try to start organizing by product surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Creates new snapshots DB models for upcoming Emerge snapshots integration. Nested in a
/snapshotsfolder to try to start organizing by product surface.