fix(proxy): set lock_timeout on team_id migration and allow CONCURRENTLY in DROP INDEX check

The team_id column migration runs a plain ALTER TABLE, so it now starts with
SET LOCAL lock_timeout like the other recent migrations.

test_drop_index_uses_if_exists rejected DROP INDEX CONCURRENTLY IF EXISTS; it
now accepts an optional CONCURRENTLY, matching the CREATE INDEX check.
This commit is contained in:
Mrinal Chanshetty 2026-10-19 20:05:20 -07:00
parent 9e2e2eb6dc
commit 79fd5378bc
2 changed files with 3 additions and 1 deletions

View file

@ -1,3 +1,5 @@
SET LOCAL lock_timeout = '10s';
-- Records the team that sent each request on its daily tag spend rows, so one tag used by
-- several teams lands in one row per team. "" means the request had no team, and every row
-- written before this migration keeps "" (attribution is not retroactive).

View file

@ -435,7 +435,7 @@ class TestMigrationSQLIdempotency:
for migration_name, sql in _guarded_migrations(all_migrations):
for line_num, line in _statements(sql):
if re.search(r"DROP\s+INDEX\s+", line, re.IGNORECASE) and not re.search(
r"DROP\s+INDEX\s+IF\s+EXISTS", line, re.IGNORECASE
r"DROP\s+INDEX\s+(?:CONCURRENTLY\s+)?IF\s+EXISTS", line, re.IGNORECASE
):
violations.append(f" {migration_name}:{line_num}: {line.strip()}")
assert (