remult 2.7.27 → 2.7.28

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.
@@ -124,7 +124,7 @@ export class SqliteCoreDataProvider {
124
124
  'create table if not exists ' + e.$entityName + ' (' + result + '\r\n)',
125
125
  ];
126
126
  if (entity.idMetadata.fields.length > 1) {
127
- sql.push(`create unique index ${this.wrapIdentifier(entity.dbName + '_primary_key')} on ${e.$entityName} (${entity.idMetadata.fields
127
+ sql.push(`create unique index if not exists ${this.wrapIdentifier(entity.dbName + '_primary_key')} on ${e.$entityName} (${entity.idMetadata.fields
128
128
  .map((x) => e.$dbNameOf(x))
129
129
  .join(',')})`);
130
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "2.7.27",
3
+ "version": "2.7.28",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -296,7 +296,7 @@ var SqliteCoreDataProvider = /** @class */ (function () {
296
296
  'create table if not exists ' + e.$entityName + ' (' + result + '\r\n)',
297
297
  ];
298
298
  if (entity.idMetadata.fields.length > 1) {
299
- sql.push("create unique index ".concat(this.wrapIdentifier(entity.dbName + '_primary_key'), " on ").concat(e.$entityName, " (").concat(entity.idMetadata.fields
299
+ sql.push("create unique index if not exists ".concat(this.wrapIdentifier(entity.dbName + '_primary_key'), " on ").concat(e.$entityName, " (").concat(entity.idMetadata.fields
300
300
  .map(function (x) { return e.$dbNameOf(x); })
301
301
  .join(','), ")"));
302
302
  }