* Unlock errors are swallowed: the session lock auto-releases on disconnect, * and a thrown unlock would falsely report a committed migration as failed.
()
| 237 | * and a thrown unlock would falsely report a committed migration as failed. |
| 238 | */ |
| 239 | async function releaseMigrationLock(): Promise<void> { |
| 240 | try { |
| 241 | await client`SELECT pg_advisory_unlock(${MIGRATION_LOCK_KEY})` |
| 242 | } catch (unlockError) { |
| 243 | console.error( |
| 244 | 'WARN: pg_advisory_unlock failed; the session lock will auto-release on disconnect.', |
| 245 | unlockError |
| 246 | ) |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Print every diagnostic field a Postgres driver puts on a thrown error. The default |