Skip to content

Commit ee812b5

Browse files
authoredAug 28, 2024··
job table pkey (#486)
* job table pkey * 10.1.1
1 parent b4965d3 commit ee812b5

8 files changed

+22
-9
lines changed
 

‎package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg-boss",
3-
"version": "10.1.0",
3+
"version": "10.1.1",
44
"description": "Queueing jobs in Postgres from Node.js like a boss",
55
"main": "./src/index.js",
66
"engines": {

‎src/migrationStore.js

+11
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ function migrate (value, version, migrations) {
6464

6565
function getAll (schema) {
6666
return [
67+
{
68+
release: '10.1.1',
69+
version: 23,
70+
previous: 22,
71+
install: [
72+
`ALTER TABLE ${schema}.job ADD PRIMARY KEY (name, id)`
73+
],
74+
uninstall: [
75+
`ALTER TABLE ${schema}.job DROP CONSTRAINT job_pkey`
76+
]
77+
},
6778
{
6879
release: '10.0.6',
6980
version: 22,

‎src/plans.js

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function create (schema, version) {
7878
createTableSubscription(schema),
7979

8080
createTableJob(schema),
81+
createPrimaryKeyJob(schema),
8182

8283
createTableArchive(schema),
8384
createPrimaryKeyArchive(schema),

‎test/exportTest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('export', function () {
2222
}
2323
})
2424

25-
it.skip('should export commands to migrate', function () {
25+
it('should export commands to migrate', function () {
2626
const schema = 'custom'
2727
const plans = PgBoss.getMigrationPlans(schema, currentSchemaVersion - 1)
2828

@@ -40,7 +40,7 @@ describe('export', function () {
4040
}
4141
})
4242

43-
it.skip('should export commands to roll back', function () {
43+
it('should export commands to roll back', function () {
4444
const schema = 'custom'
4545
const plans = PgBoss.getRollbackPlans(schema, currentSchemaVersion)
4646

‎test/migrationTest.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('migration', function () {
8282
assert.strictEqual(version, currentSchemaVersion)
8383
})
8484

85-
it.skip('should migrate through 2 versions back and forth', async function () {
85+
it('should migrate through 2 versions back and forth', async function () {
8686
const { contractor } = this.test
8787

8888
const queue = 'migrate-back-2-and-forward'
@@ -96,6 +96,7 @@ describe('migration', function () {
9696
// creating jobs in 3 states to have data to migrate back and forth
9797

9898
// completed job
99+
await boss.createQueue(queue)
99100
await boss.send(queue)
100101
const [job] = await boss.fetch(queue)
101102
await boss.complete(queue, job.id)
@@ -128,7 +129,7 @@ describe('migration', function () {
128129
await boss.complete(queue, job2.id)
129130
})
130131

131-
it.skip('should migrate to latest during start if on previous 2 schema versions', async function () {
132+
it('should migrate to latest during start if on previous 2 schema versions', async function () {
132133
const { contractor } = this.test
133134

134135
await contractor.create()

‎test/multiMasterTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('multi-master', function () {
2424
}
2525
})
2626

27-
it.skip('should only allow 1 master to migrate to latest at a time', async function () {
27+
it('should only allow 1 master to migrate to latest at a time', async function () {
2828
const config = {
2929
...this.test.bossConfig,
3030
supervise: true,

‎version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"schema": 22
2+
"schema": 23
33
}

0 commit comments

Comments
 (0)
Please sign in to comment.