From 13e2b15a9df588aba7c06546441a43e37bcf6db1 Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Wed, 9 Mar 2022 18:50:15 -0500 Subject: [PATCH] Add anti-deadlock instructions to DB update README (#1552) --- db/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/README.md b/db/README.md index d71aa4e81..4df155438 100644 --- a/db/README.md +++ b/db/README.md @@ -55,6 +55,12 @@ following steps: one. The generated SQL file from the previous step should help. New create table statements can be used as is, whereas alter table statements should be written to change any existing tables. + + Note that each incremental file MUST be limited to changes to a single + table (otherwise it may hit deadlock when applying on sandbox/production + where it'll be competing against live traffic that may also be locking said + tables but in a different order). It's OK to include these separate Flyway + scripts in a single PR. This script should be stored in a new file in the `db/src/main/resources/sql/flyway` folder using the naming pattern