@payloadcms/db-postgres 0.8.6 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +5 -52
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +3 -3
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +10 -4
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/buildFindManyArgs.js +2 -1
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/findMany.js +3 -3
- package/dist/find/traverseFields.d.ts +2 -1
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +9 -3
- package/dist/init.js +3 -2
- package/dist/migrate.js +3 -3
- package/dist/migrateDown.js +2 -2
- package/dist/migrateRefresh.js +2 -2
- package/dist/migrateReset.js +3 -3
- package/dist/migrateStatus.js +2 -2
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.js +4 -3
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +3 -1
- package/dist/queries/sanitizeQueryValue.d.ts +2 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.js +11 -2
- package/dist/schema/build.d.ts +10 -2
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +23 -6
- package/dist/schema/traverseFields.d.ts +6 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +46 -17
- package/dist/transform/read/hasManyNumber.d.ts +2 -1
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
- package/dist/transform/read/hasManyNumber.js +14 -4
- package/dist/transform/read/hasManyText.d.ts +2 -1
- package/dist/transform/read/hasManyText.d.ts.map +1 -1
- package/dist/transform/read/hasManyText.js +14 -4
- package/dist/transform/read/relationship.d.ts +2 -1
- package/dist/transform/read/relationship.d.ts.map +1 -1
- package/dist/transform/read/relationship.js +16 -7
- package/dist/transform/read/traverseFields.d.ts +5 -1
- package/dist/transform/read/traverseFields.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.js +118 -85
- package/dist/transform/write/array.d.ts +6 -1
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/array.js +7 -3
- package/dist/transform/write/blocks.d.ts +6 -1
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/blocks.js +5 -3
- package/dist/transform/write/traverseFields.d.ts +6 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.js +40 -15
- package/dist/types.d.ts +9 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.js +5 -2
- package/dist/utilities/migrationTableExists.d.ts +2 -2
- package/dist/utilities/migrationTableExists.d.ts.map +1 -1
- package/dist/utilities/migrationTableExists.js +10 -6
- package/dist/utilities/pushDevSchema.d.ts +9 -0
- package/dist/utilities/pushDevSchema.d.ts.map +1 -0
- package/dist/utilities/pushDevSchema.js +59 -0
- package/dist/utilities/requireDrizzleKit.d.ts +14 -0
- package/dist/utilities/requireDrizzleKit.d.ts.map +1 -0
- package/dist/utilities/requireDrizzleKit.js +13 -0
- package/package.json +6 -6
@@ -36,7 +36,10 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
36
36
|
arrayRowLocaleData._locale = arrayRowLocale;
|
37
37
|
rowsByTable[tableName].locales.push(arrayRowLocaleData);
|
38
38
|
if (!arrayRow.row.id) {
|
39
|
-
arrayRowLocaleData._getParentID = (rows)=>
|
39
|
+
arrayRowLocaleData._getParentID = (rows)=>{
|
40
|
+
const { id } = rows.find((each)=>each._uuid === arrayRow.row._uuid);
|
41
|
+
return id;
|
42
|
+
};
|
40
43
|
}
|
41
44
|
});
|
42
45
|
});
|
@@ -75,4 +78,4 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
75
78
|
}
|
76
79
|
};
|
77
80
|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93cy5wdXNoKGFycmF5Um93LnJvdylcblxuICAgICAgICBPYmplY3QuZW50cmllcyhhcnJheVJvdy5sb2NhbGVzKS5mb3JFYWNoKChbYXJyYXlSb3dMb2NhbGUsIGFycmF5Um93TG9jYWxlRGF0YV0pID0+
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5zZXJ0QXJyYXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQgfSBmcm9tICcuLi90cmFuc2Zvcm0vd3JpdGUvdHlwZXMnXG5pbXBvcnQgdHlwZSB7IERyaXp6bGVEQiwgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbnR5cGUgQXJncyA9IHtcbiAgYWRhcHRlcjogUG9zdGdyZXNBZGFwdGVyXG4gIGFycmF5czoge1xuICAgIFt0YWJsZU5hbWU6IHN0cmluZ106IEFycmF5Um93VG9JbnNlcnRbXVxuICB9W11cbiAgZGI6IERyaXp6bGVEQlxuICBwYXJlbnRSb3dzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG59XG5cbnR5cGUgUm93c0J5VGFibGUgPSB7XG4gIFt0YWJsZU5hbWU6IHN0cmluZ106IHtcbiAgICBhcnJheXM6IHtcbiAgICAgIFt0YWJsZU5hbWU6IHN0cmluZ106IEFycmF5Um93VG9JbnNlcnRbXVxuICAgIH1bXVxuICAgIGxvY2FsZXM6IFJlY29yZDxzdHJpbmcsIHVua25vd24+W11cbiAgICByb3dzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IGluc2VydEFycmF5cyA9IGFzeW5jICh7IGFkYXB0ZXIsIGFycmF5cywgZGIsI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xJQUFJVCxPQUFPLENBQUNPLE1BQU0sR0FBRyxHQUFHO1lBQ3BGLElBQUksQ0FBQ0UsSUFBSVQsT0FBTyxDQUFDLEVBQUUsQ0FBQ1UsU0FBUyxFQUFFO2dCQUM3QkQsSUFBSVQsT0FBTyxHQUFHUyxJQUFJVCxPQUFPLENBQUN3QixHQUFHLENBQUMsQ0FBQ0M7b0JBQzdCLElBQUksT0FBT0EsVUFBVVgsWUFBWSxLQUFLLFlBQVk7d0JBQ2hEVyxVQUFVZixTQUFTLEdBQUdlLFVBQVVYLFlBQVksQ0FBQ0k7d0JBQzdDLE9BQU9PLFVBQVVYLFlBQVk7b0JBQy9CO29CQUNBLE9BQU9XO2dCQUNUO1lBQ0Y7WUFDQSxNQUFNbkMsR0FDSDZCLE1BQU0sQ0FBQy9CLFFBQVFnQyxNQUFNLENBQUMsQ0FBQyxFQUFFdEIsVUFBVSxFQUFFVixRQUFRbUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxFQUM3REYsTUFBTSxDQUFDWixJQUFJVCxPQUFPLEVBQ2xCc0IsU0FBUztRQUNkO1FBRUEsMERBQTBEO1FBQzFELElBQUliLElBQUlwQixNQUFNLENBQUNrQixNQUFNLEdBQUcsR0FBRztZQUN6QixNQUFNcEIsYUFBYTtnQkFDakJDO2dCQUNBQyxRQUFRb0IsSUFBSXBCLE1BQU07Z0JBQ2xCQztnQkFDQUMsWUFBWTJCO1lBQ2Q7UUFDRjtJQUNGO0FBQ0YifQ==
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
export declare const migrationTableExists: (
|
1
|
+
import type { PostgresAdapter } from '../types.js';
|
2
|
+
export declare const migrationTableExists: (adapter: PostgresAdapter) => Promise<boolean>;
|
3
3
|
//# sourceMappingURL=migrationTableExists.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,oBAAoB,YAAmB,eAAe,KAAG,QAAQ,OAAO,CAapF,CAAA"}
|
@@ -9,11 +9,15 @@ Object.defineProperty(exports, "migrationTableExists", {
|
|
9
9
|
}
|
10
10
|
});
|
11
11
|
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const migrationTableExists = async (
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
const migrationTableExists = async (adapter)=>{
|
13
|
+
let statement;
|
14
|
+
if (adapter.name === 'postgres') {
|
15
|
+
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : '';
|
16
|
+
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`;
|
17
|
+
}
|
18
|
+
const result = await adapter.drizzle.execute(_drizzleorm.sql.raw(statement));
|
19
|
+
const [row] = result.rows;
|
20
|
+
return row && typeof row === 'object' && 'exists' in row && !!row.exists;
|
17
21
|
};
|
18
22
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvbWlncmF0aW9uVGFibGVFeGlzdHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMuanMnXG5cbmV4cG9ydCBjb25zdCBtaWdyYXRpb25UYWJsZUV4aXN0cyA9IGFzeW5jIChhZGFwdGVyOiBQb3N0Z3Jlc0FkYXB0ZXIpOiBQcm9taXNlPGJvb2xlYW4+ID0+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EdBQUc7UUFDeEVILFlBQVksQ0FBQyxvQkFBb0IsRUFBRUUsY0FBYyxpQ0FBaUMsQ0FBQztJQUNyRjtJQUVBLE1BQU1FLFNBQVMsTUFBTUwsUUFBUU0sT0FBTyxDQUFDQyxPQUFPLENBQUNDLGVBQUcsQ0FBQ0MsR0FBRyxDQUFDUjtJQUVyRCxNQUFNLENBQUNTLElBQUksR0FBR0wsT0FBT00sSUFBSTtJQUV6QixPQUFPRCxPQUFPLE9BQU9BLFFBQVEsWUFBWSxZQUFZQSxPQUFPLENBQUMsQ0FBQ0EsSUFBSUUsTUFBTTtBQUMxRSJ9
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { PostgresAdapter } from '../types.js';
|
2
|
+
/**
|
3
|
+
* Pushes the development schema to the database using Drizzle.
|
4
|
+
*
|
5
|
+
* @param {PostgresAdapter} adapter - The PostgresAdapter instance connected to the database.
|
6
|
+
* @returns {Promise<void>} - A promise that resolves once the schema push is complete.
|
7
|
+
*/
|
8
|
+
export declare const pushDevSchema: (adapter: PostgresAdapter) => Promise<void>;
|
9
|
+
//# sourceMappingURL=pushDevSchema.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAmB,eAAe,kBA8D3D,CAAA"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "pushDevSchema", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return pushDevSchema;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _drizzleorm = require("drizzle-orm");
|
12
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
13
|
+
const _requireDrizzleKit = require("./requireDrizzleKit");
|
14
|
+
function _interop_require_default(obj) {
|
15
|
+
return obj && obj.__esModule ? obj : {
|
16
|
+
default: obj
|
17
|
+
};
|
18
|
+
}
|
19
|
+
const pushDevSchema = async (adapter)=>{
|
20
|
+
const { pushSchema } = (0, _requireDrizzleKit.requireDrizzleKit)();
|
21
|
+
// This will prompt if clarifications are needed for Drizzle to push new schema
|
22
|
+
const { apply, hasDataLoss, warnings } = await pushSchema(adapter.schema, adapter.drizzle, adapter.schemaName ? [
|
23
|
+
adapter.schemaName
|
24
|
+
] : undefined);
|
25
|
+
if (warnings.length) {
|
26
|
+
let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
|
27
|
+
if (hasDataLoss) {
|
28
|
+
message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`;
|
29
|
+
}
|
30
|
+
message += `Accept warnings and push schema to database?`;
|
31
|
+
const { confirm: acceptWarnings } = await (0, _prompts.default)({
|
32
|
+
name: 'confirm',
|
33
|
+
type: 'confirm',
|
34
|
+
initial: false,
|
35
|
+
message
|
36
|
+
}, {
|
37
|
+
onCancel: ()=>{
|
38
|
+
process.exit(0);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
// Exit if user does not accept warnings.
|
42
|
+
// Q: Is this the right type of exit for this interaction?
|
43
|
+
if (!acceptWarnings) {
|
44
|
+
process.exit(0);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
await apply();
|
48
|
+
const migrationsTable = adapter.schemaName ? `"${adapter.schemaName}"."payload_migrations"` : '"payload_migrations"';
|
49
|
+
const { drizzle } = adapter;
|
50
|
+
const result = await drizzle.execute(_drizzleorm.sql.raw(`SELECT * FROM ${migrationsTable} WHERE batch = '-1'`));
|
51
|
+
const devPush = result.rows;
|
52
|
+
if (!devPush.length) {
|
53
|
+
await drizzle.execute(_drizzleorm.sql.raw(`INSERT INTO ${migrationsTable} (name, batch) VALUES ('dev', '-1')`));
|
54
|
+
} else {
|
55
|
+
await drizzle.execute(_drizzleorm.sql.raw(`UPDATE ${migrationsTable} SET updated_at = CURRENT_TIMESTAMP WHERE batch = '-1'`));
|
56
|
+
}
|
57
|
+
};
|
58
|
+
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcHVzaERldlNjaGVtYS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMuanMnXG5cbmltcG9ydCB7IHJlcXVpcmVEcml6emxlS2l0IH0gZnJvbSAnLi9yZXF1aXJlRHJpenpsZUtpdCdcblxuLyoqXG4gKiBQdXNoZXMgdGhlIGRldmVsb3BtZW50IHNjaGVtYSB0byB0aGUgZGF0YWJhc2UgdXNpbmcgRHJpenpsZS5cbiAqXG4gKiBAcGFyYW0ge1Bvc3RncmVzQWRhcHRlcn0gYWRhcHRlciAtIFRoZSBQb3N0Z3Jlc0FkYXB0ZXIgaW5zdGFuY2UgY29ubmVjdGVkIHRvIHRoZSBkYXRhYmFzZS5cbiAqIEByZXR1cm5zIHtQcm9taXNlPHZvaWQ+fSAtIEEgcHJvbWlzZSB0aGF0IHJlc29sdmVzIG9uY2UgdGhlIHNjaGVtYSBwdXNoIGlzIGNvbXBsZXRlLlxuICovXG5leHBvcnQgY29uc3QgcHVzaERldlNjaGVtYSA9IGFzeW5jIChhZGFwdGVyOiBQb3N0Z3Jlc0FkYXB0ZXIpID0+IHtcbiAgY29uc3QgeyBwdXNoU2NoZW1hIH0gPSByZXF1aXJlRHJpenpsZUtpdCgpXG5cbiAgLy8gVGhpcyB3aWxsIHByb21wdCBpZiBjbGFyaWZpY2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QUFFSixnQkFBZ0Isc0RBQXNELENBQUM7SUFFN0Y7QUFDRiJ9
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { PostgresAdapter } from '../types';
|
2
|
+
type RequireDrizzleKit = () => {
|
3
|
+
generateDrizzleJson: (args: {
|
4
|
+
schema: Record<string, unknown>;
|
5
|
+
}) => unknown;
|
6
|
+
pushSchema: (schema: Record<string, unknown>, drizzle: PostgresAdapter['drizzle'], filterSchema?: string[]) => Promise<{
|
7
|
+
apply: any;
|
8
|
+
hasDataLoss: any;
|
9
|
+
warnings: any;
|
10
|
+
}>;
|
11
|
+
};
|
12
|
+
export declare const requireDrizzleKit: RequireDrizzleKit;
|
13
|
+
export {};
|
14
|
+
//# sourceMappingURL=requireDrizzleKit.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"requireDrizzleKit.d.ts","sourceRoot":"","sources":["../../src/utilities/requireDrizzleKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,iBAAiB,GAAG,MAAM;IAC7B,mBAAmB,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,OAAO,CAAA;IAC3E,UAAU,EAAE,CACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,EACnC,YAAY,CAAC,EAAE,MAAM,EAAE,KACpB,OAAO,CAAC;QAAE,KAAK,MAAC;QAAC,WAAW,MAAC;QAAC,QAAQ,MAAA;KAAE,CAAC,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAAoD,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "requireDrizzleKit", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return requireDrizzleKit;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const requireDrizzleKit = ()=>require('drizzle-kit/api');
|
12
|
+
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcmVxdWlyZURyaXp6bGVLaXQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcblxudHlwZSBSZXF1aXJlRHJpenpsZUtpdCA9ICgpID0+IHtcbiAgZ2VuZXJhdGVEcml6emxlSnNvbjogKGFyZ3M6IHsgc2NoZW1hOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPiB9KSA9PiB1bmtub3duXG4gIHB1c2hTY2hlbWE6IChcbiAgICBzY2hlbWE6IFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgIGRyaXp6bGU6IFBvc3RncmVzQWRhcHRlclsnZHJpenpsZSddLFxuICAgIGZpbHRlclNjaGVtYT86IHN0cmluZ1tdLFxuICApID0+IFByb21pc2U8eyBhcHBseTsgaGFzRGF0YUxvc3M7IHdhcm5pbmdzIH0+XG59XG5cbmV4cG9ydCBjb25zdCByZXF1aXJlRHJpenpsZUtpdDogUmVxdWlyZURyaXp6bGVLaXQgPSAoKSA9PiByZXF1aXJlKCdkcml6emxlLWtpdC9hcGknKVxuIl0sIm5hbWVzIjpbInJlcXVpcmVEcml6emxlS2l0IiwicmVxdWlyZSJdLCJyYW5nZU1hcHBpbmdzIjoiOzs7Ozs7Ozs7OyIsIm1hcHBpbmdzIjoiOzs7OytCQVdhQTs7O2VBQUFBOzs7QUFBTixNQUFNQSxvQkFBdUMsSUFBTUMsUUFBUSJ9
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.8",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -19,18 +19,18 @@
|
|
19
19
|
"dependencies": {
|
20
20
|
"@libsql/client": "^0.3.1",
|
21
21
|
"console-table-printer": "2.11.2",
|
22
|
-
"drizzle-kit": "0.
|
23
|
-
"drizzle-orm": "0.
|
22
|
+
"drizzle-kit": "0.23.2-df9e596",
|
23
|
+
"drizzle-orm": "0.32.1",
|
24
24
|
"pg": "8.11.3",
|
25
25
|
"prompts": "2.4.2",
|
26
26
|
"to-snake-case": "1.0.0",
|
27
|
-
"uuid": "
|
27
|
+
"uuid": "10.0.0"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
30
|
"@types/pg": "8.10.2",
|
31
31
|
"@types/to-snake-case": "1.0.0",
|
32
|
-
"
|
33
|
-
"
|
32
|
+
"@payloadcms/eslint-config": "1.1.1",
|
33
|
+
"payload": "2.30.2"
|
34
34
|
},
|
35
35
|
"peerDependencies": {
|
36
36
|
"payload": "^2.0.0"
|