Skip to content

Commit

Permalink
job table pkey (#486)
Browse files Browse the repository at this point in the history
* job table pkey

* 10.1.1
  • Loading branch information
timgit authored Aug 28, 2024
1 parent b4965d3 commit ee812b5
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
11 changes: 11 additions & 0 deletions src/migrationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/plans.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function create (schema, version) {
createTableSubscription(schema),

createTableJob(schema),
createPrimaryKeyJob(schema),

createTableArchive(schema),
createPrimaryKeyArchive(schema),
Expand Down
4 changes: 2 additions & 2 deletions test/exportTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions test/migrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion test/multiMasterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"schema": 22
"schema": 23
}

0 comments on commit ee812b5

Please sign in to comment.