Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
741aada
feat: stream findings into the Findings tab while a review is still r…
shrsv Oct 30, 2026
eb6f474
feat: browser push notifications for review progress
shrsv Oct 30, 2026
c032dbf
chore: regenerate db/schema.sql
shrsv Oct 30, 2026
1aeea98
chore: add make db-dump to fix host/server pg_dump version mismatches
shrsv Oct 30, 2026
6a7d613
fix: check local pg_dump against server version instead of shimming v…
shrsv Oct 30, 2026
ddb43fe
fix: show the push-notification prompt from every review-trigger path
shrsv Oct 30, 2026
ef27dac
fix: replace the push-notify toast with an in-page review banner
shrsv Oct 30, 2026
7e1b277
fix: move the push-notification banner above "Back to Reviews"
shrsv Oct 30, 2026
441693f
fix: align bell icon with text in push-notification banner
shrsv Oct 30, 2026
9007481
feat: add a Settings link to the push-notification banner, center the…
shrsv Oct 30, 2026
73c0e81
fix: clarify push-notification banner copy isn't scoped to one review
shrsv Oct 30, 2026
e9d6998
fix: shorten push-notification banner copy
shrsv Oct 30, 2026
f670c59
fix: push-notification state mismatch between banner and Settings, ad…
shrsv Oct 30, 2026
afcbe3b
fix: wire push-notifier into the worker process, not just the api pro…
shrsv Oct 30, 2026
0d027e5
feat: richer push notifications (icon, review specifics, softer failu…
shrsv Oct 30, 2026
3d1fbe2
fix: Findings disappearing mid-review, and tab/URL state on review de…
shrsv Oct 30, 2026
1b86b8e
fix: Findings disappearing mid-review, add time-to-first-comment trac…
shrsv Oct 30, 2026
dadaad4
fix: comments dropped by flattenFilesByRisk once blast-radius data ar…
shrsv Oct 30, 2026
f62d3a4
fix: reviews starving on 2 workers and lying about batch failures in …
shrsv Oct 31, 2026
75c9c47
fix: review-detail/table UI truthfulness issues, resizable columns, s…
shrsv Oct 31, 2026
d4c61a5
fix: review-detail table UI/UX, finalization status, Explore nav orde…
shrsv Oct 31, 2026
bd8ce5c
fix: risk score pinned at 1.0 due to unbounded features saturating si…
shrsv Oct 31, 2026
0f7cc1c
fix: risk assessment header flickering between risk tiers on tab switch
shrsv Oct 31, 2026
38034ad
chore: ignore newly-disclosed dev-only glob/minimatch DoS CVEs in OSV…
shrsv Oct 31, 2026
9d195aa
fix: two more test fixtures left using pre-log1p raw feature values
shrsv Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-hooks-binary-allowlist
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ assets/screenshots/2026-10-29/02-settings-sso-saml.png
assets/screenshots/2026-10-29/03-login-sso-button.png
assets/screenshots/2026-10-29/04-settings-sso-scim-baseline.png
assets/screenshots/2026-10-29/05-settings-sso-reconciliation-scim-token.png

ui/public/notification-icon.png
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build build-prod run-review run-review-verbose test clean develop develop-reflex river-deps river-install river-migrate river-setup river-ui-install river-ui install-vl-convert db-flip version version-bump version-patch version-minor version-major version-bump-dirty version-patch-dirty version-minor-dirty version-major-dirty version-bump-dry version-patch-dry version-minor-dry version-major-dry build-versioned check-docker-deps update-docker-deps update-docker-deps-yes verify-docker-deps docker-build docker-build-push docker-build-dry docker-interactive docker-interactive-push docker-interactive-dry docker-build docker-build-push docker-build-versioned docker-build-push-versioned docker-build-dry docker-build-push-dry docker-context-setup ghcr-login docker-multiarch docker-multiarch-push docker-multiarch-dry docker-interactive-multiarch docker-interactive-multiarch-push cplrops vendor-prompts-encrypt vendor-prompts-build vendor-prompts-rebuild vendor-docker-build vendor-docker-build-dry vendor-docker-build-push vendor-docker-multiarch-dry vendor-docker-multiarch-push run-debug run-fast logrun api-with-migrations build-with-ui security-sbom security-sbom-cyclonedx security-sbom-spdx security-sbom-validate release-notes-init release-notes-check release-preflight release-gh niceurl niceurl2 run-api run-worker prep-dbctx
.PHONY: build build-prod run-review run-review-verbose test clean develop develop-reflex river-deps river-install river-migrate river-setup river-ui-install river-ui install-vl-convert db-flip version version-bump version-patch version-minor version-major version-bump-dirty version-patch-dirty version-minor-dirty version-major-dirty version-bump-dry version-patch-dry version-minor-dry version-major-dry build-versioned check-docker-deps update-docker-deps update-docker-deps-yes verify-docker-deps docker-build docker-build-push docker-build-dry docker-interactive docker-interactive-push docker-interactive-dry docker-build docker-build-push docker-build-versioned docker-build-push-versioned docker-build-dry docker-build-push-dry docker-context-setup ghcr-login docker-multiarch docker-multiarch-push docker-multiarch-dry docker-interactive-multiarch docker-interactive-multiarch-push cplrops vendor-prompts-encrypt vendor-prompts-build vendor-prompts-rebuild vendor-docker-build vendor-docker-build-dry vendor-docker-build-push vendor-docker-multiarch-dry vendor-docker-multiarch-push run-debug run-fast logrun api-with-migrations build-with-ui security-sbom security-sbom-cyclonedx security-sbom-spdx security-sbom-validate release-notes-init release-notes-check release-preflight release-gh niceurl niceurl2 run-api run-worker prep-dbctx db-dump
.PHONY: upload-secrets download-secrets list-secrets-files legacy-secrets-clear generate-openapi sync-docs-sources check-docs-sources
.PHONY: razorpay-webhook-ensure razorpay-webhook-ensure-dry razorpay-verify-plans razorpay-verify-plans-low-pricing
.PHONY: raw-deploy raw-deploy-low-pricing raw-deploy-backend raw-deploy-backend-low-pricing build-staging-with-ui raw-deploy-staging stop-staging ensure-seed-demo-env
Expand Down Expand Up @@ -631,6 +631,13 @@ db-flip:
@echo "New DATABASE_URL in .env:"
@grep "DATABASE_URL=" .env

# Regenerate db/schema.sql via dbmate dump, shimming pg_dump to run inside
# the livereview_pg Docker container so its version always matches the
# server (the host's own pg_dump package commonly lags behind) - see
# scripts/dbmate-dump.sh.
db-dump:
@./scripts/dbmate-dump.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: warning

make db-dump calls scripts/dbmate-dump.sh, which is not added in this diff. If the script is not already committed, the new target is broken.

Suggestions:

  1. Add scripts/dbmate-dump.sh to this changeset or verify it already exists on the base branch.
  2. Consider adding a prerequisite that fails with a clear message if the script is missing.


# Build dbctx index from local .env DATABASE_URL and import terminology
prep-dbctx: export PATH := $(HOME)/go/bin:$(PATH)
prep-dbctx:
Expand Down
10 changes: 10 additions & 0 deletions config/osv-scanner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ reason = "Not applicable - this is about echo's middleware/proxy.go (Proxy()/Pro
id = "GHSA-gcqx-w48m-w2h4"
ignoreUntil = 2027-01-28
reason = "No patched release exists. deepmerge 4.3.1 is only pulled in by dev tooling (jest, fork-ts-checker-webpack-plugin); `npm ls deepmerge --omit=dev` is empty, so it never ships and never merges untrusted input. Re-check when a fixed version is published."

[[ignoredVulns]]
id = "GHSA-3g3m-2fjr-6pw4"
ignoreUntil = 2027-01-31
reason = "DoS-only (aborted glob walks keep doing filesystem I/O in the background); only fixed in glob 14.0.2+, no backport to the 9.x-13.x line this repo's overrides/transitive resolutions use. Every occurrence (ui/package-lock.json, extension/livereview/package-lock.json) is dev-only build/test tooling (beasties-webpack-plugin, jest, mocha, @vscode/test-cli) - `npm ls glob --omit=dev` is empty in both, so it never ships. Bumping to glob 14 means bumping every dependent (webpack plugins, jest, mocha) across a major version, which is a separate, larger change than this fix warrants. Re-check when re-evaluating the dev toolchain."

[[ignoredVulns]]
id = "GHSA-g3hv-75wg-m249"
ignoreUntil = 2027-01-31
reason = "DoS-only (globparts amplification); only fixed in minimatch 11.0.1+, no backport to the 3.x/9.x/10.x lines this repo's overrides pin (minimatch@3, @9, @10 in ui/package.json). Every occurrence (ui/package-lock.json, extension/livereview/package-lock.json) is dev-only build/test tooling (eslint, jest, webpack-obfuscator, beasties-webpack-plugin, @vscode/test-cli, npm-run-all) - `npm ls minimatch --omit=dev` is empty in both, so it never ships. Bumping to minimatch 11 means bumping every dependent across a major version, which is a separate, larger change than this fix warrants. Re-check when re-evaluating the dev toolchain."
35 changes: 35 additions & 0 deletions db/migrations/20261030134721_create_push_notifications.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- migrate:up

-- One row per browser/device a user has granted push permission on (a user
-- has no single device, so this is 1:many, not a column on users).
CREATE TABLE IF NOT EXISTS push_subscriptions (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
endpoint TEXT NOT NULL UNIQUE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: warning

Ensure endpoint, p256dh, and auth_key are handled securely. While standard for web push, review overall data-at-rest encryption policies.

Suggestions:

  1. Confirm if these fields are encrypted at rest or if the push service provides sufficient security guarantees.
  2. Ensure these values are not logged excessively.

p256dh TEXT NOT NULL,
auth_key TEXT NOT NULL,
user_agent TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
last_used_at TIMESTAMPTZ
);

CREATE INDEX IF NOT EXISTS idx_push_subscriptions_user_id ON push_subscriptions(user_id);

-- A missing row means "both notification types enabled" (the agreed default),
-- so there is no backfill to do for existing users.
CREATE TABLE IF NOT EXISTS user_notification_preferences (
user_id BIGINT PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
notify_first_finding BOOLEAN NOT NULL DEFAULT TRUE,
notify_completion BOOLEAN NOT NULL DEFAULT TRUE,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Claim-once marker so concurrent batch-completion goroutines (see
-- internal/batch/task_queue.go's worker pool) can't double-send the
-- "first finding available" push for the same review.
ALTER TABLE reviews ADD COLUMN IF NOT EXISTS first_finding_notified_at TIMESTAMPTZ;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: warning

The comment claims this column prevents double-sends, but the schema alone cannot enforce that. Two concurrent senders can both read NULL, send, then update. All senders must claim the review with an atomic conditional update.

Suggestions:

  1. Use UPDATE reviews SET first_finding_notified_at = NOW() WHERE id = $1 AND first_finding_notified_at IS NULL RETURNING id as the only claim path.
  2. Add an integration test that runs two concurrent batch-completion workers against the same review.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: warning

This column only guarantees a single send if workers claim it with an atomic conditional UPDATE. A read-then-write check still allows two goroutines to send before either writes the marker.

Suggestions:

  1. Use UPDATE reviews SET first_finding_notified_at = NOW() WHERE id = $1 AND first_finding_notified_at IS NULL RETURNING id and send only when a row is returned.
  2. If a send can be retried after failure, persist a send/outbox record in the same transaction to avoid double-send on retry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: warning

A nullable timestamp alone does not enforce claim-once. Concurrent workers can both see NULL and double-send. The send path must atomically claim the review via a conditional UPDATE and check rows affected.

Suggestions:

  1. Run UPDATE reviews SET first_finding_notified_at = NOW() WHERE id = $1 AND first_finding_notified_at IS NULL and send only if rows affected = 1.
  2. Or lock the review row with SELECT ... FOR UPDATE and recheck the column before sending.


-- migrate:down
ALTER TABLE reviews DROP COLUMN IF EXISTS first_finding_notified_at;
DROP TABLE IF EXISTS user_notification_preferences;
DROP TABLE IF EXISTS push_subscriptions;
26 changes: 26 additions & 0 deletions db/migrations/20261031070300_add_ai_review_performance_prefs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- migrate:up

-- Optional per-org soft preferences for review concurrency/timeout. NULL
-- means "use the system default" (resolved at review-trigger time, see
-- internal/aiselection's review-performance resolver) - these are not hard
-- caps the org can set arbitrarily high; the resolved value is always
-- clamped to the system-wide ceiling in system_settings (row
-- 'ai_review_performance'), set by a super admin / self-hosted owner.
ALTER TABLE org_review_ai_settings
ADD COLUMN IF NOT EXISTS preferred_max_concurrent_batches INTEGER,
ADD COLUMN IF NOT EXISTS preferred_review_timeout_seconds INTEGER;

ALTER TABLE org_review_ai_settings
ADD CONSTRAINT org_review_ai_settings_preferred_max_concurrent_batches_check
CHECK (preferred_max_concurrent_batches IS NULL OR preferred_max_concurrent_batches > 0),
ADD CONSTRAINT org_review_ai_settings_preferred_review_timeout_seconds_check
CHECK (preferred_review_timeout_seconds IS NULL OR preferred_review_timeout_seconds > 0);

-- migrate:down
ALTER TABLE org_review_ai_settings
DROP CONSTRAINT IF EXISTS org_review_ai_settings_preferred_max_concurrent_batches_check,
DROP CONSTRAINT IF EXISTS org_review_ai_settings_preferred_review_timeout_seconds_check;

ALTER TABLE org_review_ai_settings
DROP COLUMN IF EXISTS preferred_max_concurrent_batches,
DROP COLUMN IF EXISTS preferred_review_timeout_seconds;
10 changes: 10 additions & 0 deletions db/migrations/20261031120000_add_review_commits_message.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- migrate:up

-- Commit message, captured best-effort from whichever provider API call already
-- fetched the commit SHA (GitHub/GitLab PR-commits endpoints both return it). Null
-- for older rows and for sources that never had one available (e.g. local staged
-- commits recorded before a message was ever sent).
ALTER TABLE review_commits ADD COLUMN IF NOT EXISTS message TEXT;

-- migrate:down
ALTER TABLE review_commits DROP COLUMN IF EXISTS message;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- migrate:up

-- riskscore.Prior() changed: every structurally-unbounded count/sum feature
-- (br_sum, br_high_count, critical_count, warning_count, security_count, and
-- the 9 taxonomy counts) is now log1p-compressed before scoring, with weights
-- retuned to match. The old br_sum weight assumed a 0-100 range, but br_sum is
-- actually a raw, unbounded SUM(combined) across every blast-radius hunk in a
-- diff (real production values ran 1700-4840), which saturated the sigmoid
-- past the point float64 can represent 1+exp(-z) as anything but exactly 1.0
-- - confirmed in production, where an org's entire risk-score history was
-- pinned to exactly 1.0 for every review. See internal/riskscore/model.go's
-- Prior() doc comment and internal/riskscore/saturation_test.go for the full
-- investigation and regression coverage.
--
-- EnsureSeedModel (internal/riskscore/store.go) only inserts the shared seed
-- row (org_id IS NULL, update_kind = 'seed') if one doesn't already exist - it
-- never updates one in place. At the time this migration was written, that
-- table held exactly one row in production, and no org had ever trained a
-- custom model (training_sample_count was 0 everywhere) - so there is no
-- fitted-model data to preserve or migrate. Deleting the stale row lets
-- EnsureSeedModel's existing idempotent bootstrap logic reinsert it from the
-- corrected Prior() the next time any review is scored, with no new code path
-- needed.
DELETE FROM risk_model_versions WHERE org_id IS NULL AND update_kind = 'seed';

-- migrate:down

-- Data-only reset; the prior seed weights are not reconstructed here (see git
-- history for the exact values this migration replaced). EnsureSeedModel will
-- reinsert a seed row from whatever Prior() the running code defines, same as
-- after any fresh deploy - there is no way to "undo" this short of also
-- reverting the Prior()/ExtractFeatures code changes.
DELETE FROM risk_model_versions WHERE org_id IS NULL AND update_kind = 'seed';
121 changes: 117 additions & 4 deletions db/schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\restrict dbmate

-- Dumped from database version 18.6 (Debian 18.6-1.pgdg13+2)
-- Dumped by pg_dump version 18.6 (Debian 18.6-1.pgdg13+2)
-- Dumped by pg_dump version 18.6 (Ubuntu 18.6-1.pgdg24.04+2)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down Expand Up @@ -2066,7 +2066,11 @@ CREATE TABLE public.org_review_ai_settings (
helper_mode character varying(32) DEFAULT 'concise_then_expand'::character varying NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT org_review_ai_settings_helper_mode_check CHECK (((helper_mode)::text = ANY (ARRAY[('concise_then_expand'::character varying)::text, ('polish_only'::character varying)::text])))
preferred_max_concurrent_batches integer,
preferred_review_timeout_seconds integer,
CONSTRAINT org_review_ai_settings_helper_mode_check CHECK (((helper_mode)::text = ANY (ARRAY[('concise_then_expand'::character varying)::text, ('polish_only'::character varying)::text]))),
CONSTRAINT org_review_ai_settings_preferred_max_concurrent_batches_check CHECK (((preferred_max_concurrent_batches IS NULL) OR (preferred_max_concurrent_batches > 0))),
CONSTRAINT org_review_ai_settings_preferred_review_timeout_seconds_check CHECK (((preferred_review_timeout_seconds IS NULL) OR (preferred_review_timeout_seconds > 0)))
);


Expand Down Expand Up @@ -2467,6 +2471,41 @@ CREATE SEQUENCE public.pull_requests_id_seq
ALTER SEQUENCE public.pull_requests_id_seq OWNED BY public.pull_requests.id;


--
-- Name: push_subscriptions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.push_subscriptions (
id bigint NOT NULL,
user_id bigint NOT NULL,
endpoint text NOT NULL,
p256dh text NOT NULL,
auth_key text NOT NULL,
user_agent text,
created_at timestamp with time zone DEFAULT now() NOT NULL,
last_used_at timestamp with time zone
);


--
-- Name: push_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.push_subscriptions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: push_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.push_subscriptions_id_seq OWNED BY public.push_subscriptions.id;


--
-- Name: quota_batch_settlements; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -2772,6 +2811,7 @@ CREATE TABLE public.review_commits (
ref character varying(160) NOT NULL,
ref_type text DEFAULT 'commit'::text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
message text,
CONSTRAINT review_commits_ref_type_check CHECK ((ref_type = ANY (ARRAY['commit'::text, 'range'::text])))
);

Expand Down Expand Up @@ -3032,6 +3072,7 @@ CREATE TABLE public.reviews (
author_username text,
friendly_name text,
pull_request_id bigint,
first_finding_notified_at timestamp with time zone,
CONSTRAINT reviews_status_check CHECK (((status)::text = ANY (ARRAY[('created'::character varying)::text, ('in_progress'::character varying)::text, ('completed'::character varying)::text, ('failed'::character varying)::text])))
);

Expand Down Expand Up @@ -4023,6 +4064,18 @@ CREATE SEQUENCE public.user_management_audit_id_seq
ALTER SEQUENCE public.user_management_audit_id_seq OWNED BY public.user_management_audit.id;


--
-- Name: user_notification_preferences; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.user_notification_preferences (
user_id bigint NOT NULL,
notify_first_finding boolean DEFAULT true NOT NULL,
notify_completion boolean DEFAULT true NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL
);


--
-- Name: user_role_history; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -4095,7 +4148,8 @@ CREATE TABLE public.users (
onboarding_api_key text,
last_cli_used_at timestamp with time zone,
default_org_id bigint,
review_level integer DEFAULT 1 NOT NULL
review_level integer DEFAULT 1 NOT NULL,
time_zone text

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: info

The time_zone column was added to the users table. This is a good addition for internationalization and personalized time display.

Suggestions:

  1. Consider how existing users will be migrated or assigned a default time zone.
  2. Ensure application logic correctly uses this time zone for display and operations.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: critical

The time_zone column addition to the users table is not included in the provided 359-47-857674721_create_push_notifications.sql migration. This indicates a missing migration file or a partial diff in the review request.

Suggestions:

  1. Ensure all relevant migration files are included in the review scope.
  2. If this change is from a separate migration, add that migration file to the diff for review.

);


Expand Down Expand Up @@ -4484,6 +4538,13 @@ ALTER TABLE ONLY public.prompt_chunks ALTER COLUMN id SET DEFAULT nextval('publi
ALTER TABLE ONLY public.pull_requests ALTER COLUMN id SET DEFAULT nextval('public.pull_requests_id_seq'::regclass);


--
-- Name: push_subscriptions id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.push_subscriptions ALTER COLUMN id SET DEFAULT nextval('public.push_subscriptions_id_seq'::regclass);


--
-- Name: quota_batch_settlements id; Type: DEFAULT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -5220,6 +5281,22 @@ ALTER TABLE ONLY public.pull_requests
ADD CONSTRAINT pull_requests_pkey PRIMARY KEY (id);


--
-- Name: push_subscriptions push_subscriptions_endpoint_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.push_subscriptions
ADD CONSTRAINT push_subscriptions_endpoint_key UNIQUE (endpoint);


--
-- Name: push_subscriptions push_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.push_subscriptions
ADD CONSTRAINT push_subscriptions_pkey PRIMARY KEY (id);


--
-- Name: quota_batch_settlements quota_batch_settlements_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -5692,6 +5769,14 @@ ALTER TABLE ONLY public.user_management_audit
ADD CONSTRAINT user_management_audit_pkey PRIMARY KEY (id);


--
-- Name: user_notification_preferences user_notification_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.user_notification_preferences
ADD CONSTRAINT user_notification_preferences_pkey PRIMARY KEY (user_id);


--
-- Name: user_role_history user_role_history_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -7412,6 +7497,13 @@ CREATE INDEX idx_pull_requests_org_state ON public.pull_requests USING btree (or
CREATE INDEX idx_pull_requests_repository_state ON public.pull_requests USING btree (repository_id, state);


--
-- Name: idx_push_subscriptions_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_push_subscriptions_user_id ON public.push_subscriptions USING btree (user_id);


--
-- Name: idx_quota_batch_settlements_org_idempotency; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -9768,6 +9860,14 @@ ALTER TABLE ONLY public.pull_requests
ADD CONSTRAINT pull_requests_repository_id_fkey FOREIGN KEY (repository_id) REFERENCES public.repositories(id) ON DELETE CASCADE;


--
-- Name: push_subscriptions push_subscriptions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.push_subscriptions
ADD CONSTRAINT push_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: quota_batch_settlements quota_batch_settlements_org_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -10256,6 +10356,14 @@ ALTER TABLE ONLY public.user_management_audit
ADD CONSTRAINT user_management_audit_target_user_id_fkey FOREIGN KEY (target_user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: user_notification_preferences user_notification_preferences_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.user_notification_preferences
ADD CONSTRAINT user_notification_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: user_role_history user_role_history_changed_by_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -10490,7 +10598,12 @@ INSERT INTO public.schema_migrations (version) VALUES
('20261025120100'),
('20261025130000'),
('20261029104047'),
('20261029120000'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: critical

The migration version 207-17-107000000 is included in schema_migrations but the corresponding migration file is not part of this diff. This suggests a missing migration or a partial review.

Suggestions:

  1. Include all migration files that contribute to the schema.sql changes in the review.
  2. Verify that all schema changes are accounted for by explicit migrations.

('20261029134500'),
('20261029150000'),
('20261029150100'),
('20261029150200');
('20261029150200'),
('20261030134721'),
('20261031070300'),
('20261031120000'),
('20261031140000');
Loading
Loading