chore(database): set maxopen to 1 for migrations
Context
In Cannot disable per-session statement timeouts f... (#889 - closed) we attempted to find a solution to run post-deployment migrations using a single connection. This is due to various factors described in that issue.
As part of the conversation, we identified a follow-up plan to ensure we can run the migrations on a single connection but with a different approach.
Solution
- Implement Add configuration to use service discovery to i... (#890 - closed) first
- Override
database.pool.maxopento 1 when applying migrations. This is not guaranteed to work forever, but for now, it seems an effective workaround to enforce a single connection.