diff --git a/package-lock.json b/package-lock.json index 62fe247..682a44b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pg-boss", - "version": "10.1.0", + "version": "10.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pg-boss", - "version": "10.1.0", + "version": "10.1.1", "license": "MIT", "dependencies": { "cron-parser": "^4.0.0", diff --git a/package.json b/package.json index a55974d..6c6be3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pg-boss", - "version": "10.1.0", + "version": "10.1.1", "description": "Queueing jobs in Postgres from Node.js like a boss", "main": "./src/index.js", "engines": { diff --git a/src/migrationStore.js b/src/migrationStore.js index cb080b7..251fd36 100644 --- a/src/migrationStore.js +++ b/src/migrationStore.js @@ -64,6 +64,17 @@ function migrate (value, version, migrations) { function getAll (schema) { return [ + { + release: '10.1.1', + version: 23, + previous: 22, + install: [ + `ALTER TABLE ${schema}.job ADD PRIMARY KEY (name, id)` + ], + uninstall: [ + `ALTER TABLE ${schema}.job DROP CONSTRAINT job_pkey` + ] + }, { release: '10.0.6', version: 22, diff --git a/src/plans.js b/src/plans.js index ba72e03..bbb24b3 100644 --- a/src/plans.js +++ b/src/plans.js @@ -78,6 +78,7 @@ function create (schema, version) { createTableSubscription(schema), createTableJob(schema), + createPrimaryKeyJob(schema), createTableArchive(schema), createPrimaryKeyArchive(schema), diff --git a/test/exportTest.js b/test/exportTest.js index 827768e..2505b17 100644 --- a/test/exportTest.js +++ b/test/exportTest.js @@ -22,7 +22,7 @@ describe('export', function () { } }) - it.skip('should export commands to migrate', function () { + it('should export commands to migrate', function () { const schema = 'custom' const plans = PgBoss.getMigrationPlans(schema, currentSchemaVersion - 1) @@ -40,7 +40,7 @@ describe('export', function () { } }) - it.skip('should export commands to roll back', function () { + it('should export commands to roll back', function () { const schema = 'custom' const plans = PgBoss.getRollbackPlans(schema, currentSchemaVersion) diff --git a/test/migrationTest.js b/test/migrationTest.js index 8df4093..97c60ef 100644 --- a/test/migrationTest.js +++ b/test/migrationTest.js @@ -82,7 +82,7 @@ describe('migration', function () { assert.strictEqual(version, currentSchemaVersion) }) - it.skip('should migrate through 2 versions back and forth', async function () { + it('should migrate through 2 versions back and forth', async function () { const { contractor } = this.test const queue = 'migrate-back-2-and-forward' @@ -96,6 +96,7 @@ describe('migration', function () { // creating jobs in 3 states to have data to migrate back and forth // completed job + await boss.createQueue(queue) await boss.send(queue) const [job] = await boss.fetch(queue) await boss.complete(queue, job.id) @@ -128,7 +129,7 @@ describe('migration', function () { await boss.complete(queue, job2.id) }) - it.skip('should migrate to latest during start if on previous 2 schema versions', async function () { + it('should migrate to latest during start if on previous 2 schema versions', async function () { const { contractor } = this.test await contractor.create() diff --git a/test/multiMasterTest.js b/test/multiMasterTest.js index 02717c8..c2051eb 100644 --- a/test/multiMasterTest.js +++ b/test/multiMasterTest.js @@ -24,7 +24,7 @@ describe('multi-master', function () { } }) - it.skip('should only allow 1 master to migrate to latest at a time', async function () { + it('should only allow 1 master to migrate to latest at a time', async function () { const config = { ...this.test.bossConfig, supervise: true, diff --git a/version.json b/version.json index 65ca78b..2e6fc91 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "schema": 22 + "schema": 23 }