remult 2.7.26 → 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
|
}
|
|
@@ -205,7 +205,7 @@ export class RemultServerImplementation {
|
|
|
205
205
|
if (this.options.admin !== undefined && this.options.admin !== false) {
|
|
206
206
|
const admin = () => this.process(async (remult, req, res, orig, origResponse) => {
|
|
207
207
|
if (remult.isAllowed(this.options.admin)) {
|
|
208
|
-
if (orig
|
|
208
|
+
if (orig?.params?.id === '__entities-metadata') {
|
|
209
209
|
res.success(buildEntityInfo({
|
|
210
210
|
remult,
|
|
211
211
|
entities: this.options.entities ?? [],
|
package/package.json
CHANGED
package/remult-sqlite-core.js
CHANGED
|
@@ -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
|
}
|
|
@@ -364,13 +364,13 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
364
364
|
if (this.options.admin !== undefined && this.options.admin !== false) {
|
|
365
365
|
var admin = function () {
|
|
366
366
|
return _this.process(function (remult, req, res, orig, origResponse) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
367
|
-
var _a;
|
|
368
|
-
return tslib_1.__generator(this, function (
|
|
367
|
+
var _a, _b;
|
|
368
|
+
return tslib_1.__generator(this, function (_c) {
|
|
369
369
|
if (remult.isAllowed(this.options.admin)) {
|
|
370
|
-
if (orig.params.id === '__entities-metadata') {
|
|
370
|
+
if (((_a = orig === null || orig === void 0 ? void 0 : orig.params) === null || _a === void 0 ? void 0 : _a.id) === '__entities-metadata') {
|
|
371
371
|
res.success((0, remult_admin_js_1.buildEntityInfo)({
|
|
372
372
|
remult: remult,
|
|
373
|
-
entities: (
|
|
373
|
+
entities: (_b = this.options.entities) !== null && _b !== void 0 ? _b : [],
|
|
374
374
|
}));
|
|
375
375
|
}
|
|
376
376
|
else {
|