Skip to content

feat(subscriptions): add postgres connection and alembic migrations - #8563

Open
ldelvoye wants to merge 1 commit into
masterfrom
ldelvoye/feat/subscriptions-postgres-tooling
Open

ldelvoye wants to merge 1 commit into
masterfrom
ldelvoye/feat/subscriptions-postgres-tooling

Conversation

@ldelvoye

Copy link
Copy Markdown
Member

resolves INFRENG-678

Adds a Postgres connection and alembic migrations for the subscription store, with a first migration creating the subscriptions table and a snuba subscriptions-postgres migrate command to run it. Nothing reads or writes the table yet; that comes with the store itself in INFRENG-679.

I put the migrations in snuba/subscriptions/postgres/migrations/, next to the code that'll use them, and they run on plain alembic. They have nothing to do with snuba's ClickHouse migration system: there's no group to register, and snuba migrations never sees them. I did consider putting them under snuba/snuba_migrations/ so all of snuba's migrations live in one place, but the tooling there assumes ClickHouse (check-migrations.py would fail this PR for mixing migrations with other code, and ddl-changes.py would parse them as ClickHouse DDL). Keeping them with the feature is also how sentry does it with Django, where each app has its own migrations/ folder. If you'd rather have everything in one place, I'm happy to move them.

Sets up the Postgres side of the subscription store: settings for the
app and migrations URLs, a pgbouncer-safe engine, the subscriptions
table, and a migrate command. The devserver and CI get a local Postgres.
@ldelvoye
ldelvoye requested a review from a team as a code owner October 19, 2026 16:52
@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

INFRENG-678

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant