From 79a8dcaaf94410a3c89a8240726fcaf83a2929c0 Mon Sep 17 00:00:00 2001 From: Jason Claxton Date: Mon, 20 Nov 2023 15:07:04 +0000 Subject: [PATCH 1/3] Rename `package.json` migration scripts https://github.com/DEFRA/water-abstraction-team/issues/106 To deploy this using our existing scripts we have to be able to call `npm run migrate`. If we kept the naming convention we would have to rewrite our deployment scripts, so it is easier if we just re-name our scripts in here. From 7181f723511e0b99ef04f3b21540b8adc2fd2928 Mon Sep 17 00:00:00 2001 From: Jason Claxton Date: Mon, 20 Nov 2023 15:09:37 +0000 Subject: [PATCH 2/3] Update to remove db prefix --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c15ae858df..d5e70802ec 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,13 @@ "scripts": { "start": "node index.js", "build": "bin/build", - "db:migrate:make": "knex migrate:make --", - "db:migrate:make:test": "NODE_ENV=test knex migrate:make --migrations-directory db/migrations/legacy --", - "db:migrate": "knex migrate:latest", - "db:migrate:test": "NODE_ENV=test knex migrate:latest", - "db:rollback": "knex migrate:rollback --all", - "db:rollback:test": "NODE_ENV=test knex migrate:rollback --all", - "db:seed": "knex seed:run --knexfile knexfile.application.js", + "migrate:make": "knex migrate:make --", + "migrate:make:test": "NODE_ENV=test knex migrate:make --migrations-directory db/migrations/legacy --", + "migrate": "knex migrate:latest", + "migrate:test": "NODE_ENV=test knex migrate:latest", + "rollback": "knex migrate:rollback --all", + "rollback:test": "NODE_ENV=test knex migrate:rollback --all", + "seed": "knex seed:run --knexfile knexfile.application.js", "lint": "standard", "test": "lab --silent-skips --shuffle", "postinstall": "npm run build", From f3ae22d004b131b9405383e5e7e4c91c89c6432f Mon Sep 17 00:00:00 2001 From: Jason Claxton Date: Mon, 20 Nov 2023 15:11:55 +0000 Subject: [PATCH 3/3] Update ci to reflect `package.json` change --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4632b1b2f4..c5f4e9ee1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,7 @@ jobs: - name: Database migrations run: | - npm run db:migrate:test + npm run migrate:test # This includes an extra run step. The sonarcloud analysis will be run in a docker container with the current # folder mounted as `/github/workspace`. The problem is when the lcov.info file is generated it will reference the