@mikro-orm/postgresql 6.6.10-dev.0 → 6.6.10-dev.1

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.
@@ -313,15 +313,9 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
313
313
  const m1 = item.definition?.match(/check \(\(\("?(\w+)"?\)::/i) || item.definition?.match(/check \(\("?(\w+)"? = /i);
314
314
  const m2 = item.definition?.match(/\(array\[(.*)]\)/i) || item.definition?.match(/ = (.*)\)/i);
315
315
  if (item.columnName && m1 && m2) {
316
- const m3 = m2[1].match(/('[^']*'::text)/g);
317
- let items;
318
- /* istanbul ignore else */
319
- if (m3) {
320
- items = m3.map((item) => item.trim().match(/^\(?'(.*)'/)?.[1]);
321
- }
322
- else {
323
- items = m2[1].split(',').map((item) => item.trim().match(/^\(?'(.*)'/)?.[1]);
324
- }
316
+ /* istanbul ignore next */
317
+ const parts = m2[1].match(/('(?:[^']|'')*'::\w[\w ]*)/g) ?? m2[1].split(',');
318
+ let items = parts.map((item) => item.trim().match(/^\(?'((?:[^']|'')*)'/)?.[1]?.replace(/''/g, "'"));
325
319
  items = items.filter(item => item !== undefined);
326
320
  if (items.length > 0) {
327
321
  o[item.columnName] = items;
@@ -359,7 +353,7 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
359
353
  if (changedProperties && column.mappedType instanceof core_1.EnumType && column.enumItems?.every(item => core_1.Utils.isString(item))) {
360
354
  const checkName = this.platform.getConfig().getNamingStrategy().indexName(fromTable.name, [column.name], 'check');
361
355
  if (changedProperties.has('enumItems') || (!column.nativeEnumName && fromTable.getColumn(column.name)?.nativeEnumName)) {
362
- table.check(`${this.platform.quoteIdentifier(column.name)} in ('${(column.enumItems.join("', '"))}')`, {}, this.platform.quoteIdentifier(checkName));
356
+ table.check(`${this.platform.quoteIdentifier(column.name)} in (${column.enumItems.map(v => this.platform.quoteValue(v)).join(', ')})`, {}, this.platform.quoteIdentifier(checkName));
363
357
  }
364
358
  if (changedProperties.has('type')) {
365
359
  return table.specificType(column.name, column.type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/postgresql",
3
- "version": "6.6.10-dev.0",
3
+ "version": "6.6.10-dev.1",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -58,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@mikro-orm/knex": "6.6.10-dev.0",
61
+ "@mikro-orm/knex": "6.6.10-dev.1",
62
62
  "pg": "8.19.0",
63
63
  "postgres-array": "3.0.4",
64
64
  "postgres-date": "2.1.0",
@@ -68,6 +68,6 @@
68
68
  "@mikro-orm/core": "^6.6.9"
69
69
  },
70
70
  "peerDependencies": {
71
- "@mikro-orm/core": "6.6.10-dev.0"
71
+ "@mikro-orm/core": "6.6.10-dev.1"
72
72
  }
73
73
  }