Skip to content

Commit a50046d

Browse files
authored
migrations: ensure .sql files are executed in order (#1665)
Related: getodk/central#1456 Closes getodk/central#1445
1 parent c0d4b65 commit a50046d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/model/migrations/20250927-01-geoextracts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ const down = async (db) => {
3434

3535

3636
const up = async (db) => {
37-
getSqlFiles('up').forEach(async sql => {
37+
for (const sql of getSqlFiles('up')) {
3838
// See sidecar .sql files
39-
await db.raw(sql);
40-
});
39+
await db.raw(sql); // eslint-disable-line no-await-in-loop
40+
}
4141
};
4242

4343

lib/model/migrations/20250928-01-backfill-submission-geocache-createfunction.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const down = async (db) => {
3333

3434

3535
const up = async (db) => {
36-
getSqlFiles('up').forEach(async sql => {
36+
for (const sql of getSqlFiles('up')) {
3737
// See sidecar .sql files
38-
await db.raw(sql);
39-
});
38+
await db.raw(sql); // eslint-disable-line no-await-in-loop
39+
}
4040
};
4141

4242

0 commit comments

Comments
 (0)