@ruiapp/rapid-core 0.5.4 → 0.5.5

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.
package/dist/index.js CHANGED
@@ -4840,6 +4840,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
4840
4840
  autoIncrement: false,
4841
4841
  notNull: property.required,
4842
4842
  });
4843
+ await server.tryQueryDatabaseObject(columnDDL);
4843
4844
  }
4844
4845
  if (!columnInDb || columnInDb.description != property.name) {
4845
4846
  await server.queryDatabaseObject(`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(property.targetIdColumnName)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`, []);
@@ -4864,6 +4865,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
4864
4865
  schema: property.linkSchema,
4865
4866
  tableName: property.linkTableName,
4866
4867
  })} ADD CONSTRAINT ${queryBuilder.quoteObject(contraintName)} PRIMARY KEY (id);`;
4868
+ await server.tryQueryDatabaseObject(columnDDL);
4867
4869
  }
4868
4870
  else {
4869
4871
  const targetModel = applicationConfig.models.find((item) => item.singularCode === property.targetSingularCode);
@@ -4885,15 +4887,13 @@ async function syncDatabaseSchema(server, applicationConfig) {
4885
4887
  autoIncrement: false,
4886
4888
  notNull: property.required,
4887
4889
  });
4890
+ await server.tryQueryDatabaseObject(columnDDL);
4888
4891
  }
4889
4892
  }
4890
4893
  }
4891
4894
  else {
4892
4895
  continue;
4893
4896
  }
4894
- if (columnDDL) {
4895
- await server.tryQueryDatabaseObject(columnDDL);
4896
- }
4897
4897
  }
4898
4898
  else {
4899
4899
  const columnName = property.columnName || property.code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -260,6 +260,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
260
260
  autoIncrement: false,
261
261
  notNull: property.required,
262
262
  });
263
+ await server.tryQueryDatabaseObject(columnDDL);
263
264
  }
264
265
 
265
266
  if (!columnInDb || columnInDb.description != property.name) {
@@ -290,6 +291,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
290
291
  schema: property.linkSchema,
291
292
  tableName: property.linkTableName,
292
293
  })} ADD CONSTRAINT ${queryBuilder.quoteObject(contraintName)} PRIMARY KEY (id);`;
294
+ await server.tryQueryDatabaseObject(columnDDL);
293
295
  } else {
294
296
  const targetModel = applicationConfig.models.find((item) => item.singularCode === property.targetSingularCode);
295
297
  if (!targetModel) {
@@ -312,15 +314,12 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
312
314
  autoIncrement: false,
313
315
  notNull: property.required,
314
316
  });
317
+ await server.tryQueryDatabaseObject(columnDDL);
315
318
  }
316
319
  }
317
320
  } else {
318
321
  continue;
319
322
  }
320
-
321
- if (columnDDL) {
322
- await server.tryQueryDatabaseObject(columnDDL);
323
- }
324
323
  } else {
325
324
  const columnName = property.columnName || property.code;
326
325
  const columnInDb: ColumnInformation | undefined = find(columnsInDb, {