pg-boss 10.0.0-beta8 → 10.0.0-beta9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/plans.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-boss",
3
- "version": "10.0.0-beta8",
3
+ "version": "10.0.0-beta9",
4
4
  "description": "Queueing jobs in Postgres from Node.js like a boss",
5
5
  "main": "./src/index.js",
6
6
  "engines": {
package/src/plans.js CHANGED
@@ -186,7 +186,7 @@ function getPartitionFunction (schema) {
186
186
  return `
187
187
  CREATE FUNCTION ${schema}.get_partition(queue_name text, out name text) AS
188
188
  $$
189
- SELECT '${schema}.job_' || encode(sha224(queue_name::bytea), 'hex');
189
+ SELECT 'job_' || encode(sha224(queue_name::bytea), 'hex');
190
190
  $$
191
191
  LANGUAGE SQL
192
192
  IMMUTABLE
@@ -201,9 +201,9 @@ function createPartitionFunction (schema) {
201
201
  DECLARE
202
202
  table_name varchar := ${schema}.get_partition(queue_name);
203
203
  BEGIN
204
- EXECUTE format('CREATE TABLE %I (LIKE ${schema}.job INCLUDING DEFAULTS INCLUDING CONSTRAINTS)', table_name);
205
- EXECUTE format('ALTER TABLE %I ADD CHECK (name=%L)', table_name, queue_name);
206
- EXECUTE format('ALTER TABLE ${schema}.job ATTACH PARTITION %I FOR VALUES IN (%L)', table_name, queue_name);
204
+ EXECUTE format('CREATE TABLE ${schema}.%I (LIKE ${schema}.job INCLUDING DEFAULTS INCLUDING CONSTRAINTS)', table_name);
205
+ EXECUTE format('ALTER TABLE ${schema}.%I ADD CHECK (name=%L)', table_name, queue_name);
206
+ EXECUTE format('ALTER TABLE ${schema}.job ATTACH PARTITION ${schema}.%I FOR VALUES IN (%L)', table_name, queue_name);
207
207
  END;
208
208
  $$
209
209
  LANGUAGE plpgsql;