@mikro-orm/sql 7.2.10-dev.16 → 7.2.10-dev.17
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.
|
@@ -1279,9 +1279,11 @@ export class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
1279
1279
|
const name = (schemaName && schemaName !== this.platform.getDefaultSchemaName() ? schemaName + '.' : '') + tableName;
|
|
1280
1280
|
if (column.autoincrement) {
|
|
1281
1281
|
const seqName = this.platform.getIndexName(tableName, [column.name], 'sequence');
|
|
1282
|
+
// the regclass text needs the quoted name too, otherwise postgres folds a mixed case name to lower case
|
|
1283
|
+
const seq = this.platform.quoteValue(this.quote(seqName));
|
|
1282
1284
|
ret.push(`create sequence if not exists ${this.quote(seqName)}`);
|
|
1283
|
-
ret.push(`select setval(
|
|
1284
|
-
ret.push(`alter table ${this.quote(name)} alter column ${this.quote(column.name)} set default nextval(
|
|
1285
|
+
ret.push(`select setval(${seq}, (select max(${this.quote(column.name)}) from ${this.quote(name)}))`);
|
|
1286
|
+
ret.push(`alter table ${this.quote(name)} alter column ${this.quote(column.name)} set default nextval(${seq})`);
|
|
1285
1287
|
}
|
|
1286
1288
|
return ret;
|
|
1287
1289
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.2.10-dev.
|
|
3
|
+
"version": "7.2.10-dev.17",
|
|
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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@mikro-orm/core": "^7.2.9"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.2.10-dev.
|
|
56
|
+
"@mikro-orm/core": "7.2.10-dev.17"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|