Skip to content

Commit

Permalink
Makefile: remove check-migrations
Browse files Browse the repository at this point in the history
Closes: getodk#1397
  • Loading branch information
alxndrsn committed Feb 11, 2025
1 parent 4af4f33 commit 4920acf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,12 @@ fake-s3-server-persistent:
migrations: node_version
node lib/bin/run-migrations.js

.PHONY: check-migrations
check-migrations: node_version
node lib/bin/check-migrations.js


################################################################################
# RUN SERVER

.PHONY: base
base: node_modules node_version migrations check-migrations
base: node_modules node_version migrations

.PHONY: dev
dev: base
Expand Down
19 changes: 0 additions & 19 deletions lib/bin/check-migrations.js

This file was deleted.

10 changes: 1 addition & 9 deletions lib/model/knex-migrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,5 @@ const withKnex = (config) => (mutator) => {
// Given a database, initiates migrations on it.
const migrate = (db) => db.migrate.latest({ directory: `${__dirname}/migrations` });

// Checks for pending migrations and returns an exit code of 1 if any are
// still pending/unapplied (e.g. automatically running migrations just failed).
const checkMigrations = (db) => db.migrate.list({ directory: `${__dirname}/migrations` })
.then((res) => {
if (res[1].length > 0)
process.exitCode = 1;
});

module.exports = { checkMigrations, knexConnect, withKnex, migrate };
module.exports = { knexConnect, withKnex, migrate };

0 comments on commit 4920acf

Please sign in to comment.