@nocobase/database 2.0.0-alpha.47 → 2.0.0-alpha.49
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.
|
@@ -47,7 +47,7 @@ import_dayjs.default.extend(import_utc.default);
|
|
|
47
47
|
const _TimeInterface = class _TimeInterface extends import_base_interface.BaseInterface {
|
|
48
48
|
toValue(value, ctx) {
|
|
49
49
|
if (this.validate(value)) {
|
|
50
|
-
const result = import_dayjs.default
|
|
50
|
+
const result = (0, import_dayjs.default)(value).format("HH:mm:ss");
|
|
51
51
|
return result;
|
|
52
52
|
}
|
|
53
53
|
return value;
|
|
@@ -51,7 +51,6 @@ module.exports = __toCommonJS(single_relation_repository_exports);
|
|
|
51
51
|
var import_target_collection_decorator = __toESM(require("../decorators/target-collection-decorator"));
|
|
52
52
|
var import_update_associations = require("../update-associations");
|
|
53
53
|
var import_relation_repository = require("./relation-repository");
|
|
54
|
-
var import_lodash = __toESM(require("lodash"));
|
|
55
54
|
const _SingleRelationRepository = class _SingleRelationRepository extends import_relation_repository.RelationRepository {
|
|
56
55
|
async remove(options) {
|
|
57
56
|
const transaction2 = await this.getTransaction(options);
|
|
@@ -104,7 +103,7 @@ const _SingleRelationRepository = class _SingleRelationRepository extends import
|
|
|
104
103
|
throw new Error("The record does not exist");
|
|
105
104
|
}
|
|
106
105
|
await (0, import_update_associations.updateModelByValues)(target, options == null ? void 0 : options.values, {
|
|
107
|
-
...
|
|
106
|
+
...options,
|
|
108
107
|
transaction: transaction2
|
|
109
108
|
});
|
|
110
109
|
if (options.hooks !== false) {
|
|
@@ -220,11 +220,11 @@ async function updateSingleAssociation(model, key, value, options = {}) {
|
|
|
220
220
|
}
|
|
221
221
|
}, "checkBelongsToForeignKeyValue");
|
|
222
222
|
if ((0, import_utils.isStringOrNumber)(value)) {
|
|
223
|
-
await model[setAccessor](value, { context, transaction
|
|
223
|
+
await model[setAccessor](value, { context, transaction });
|
|
224
224
|
return true;
|
|
225
225
|
}
|
|
226
226
|
if (value instanceof import_model.Model) {
|
|
227
|
-
await model[setAccessor](value, { context, transaction
|
|
227
|
+
await model[setAccessor](value, { context, transaction });
|
|
228
228
|
model.setDataValue(key, value);
|
|
229
229
|
return true;
|
|
230
230
|
}
|
|
@@ -255,7 +255,7 @@ async function updateSingleAssociation(model, key, value, options = {}) {
|
|
|
255
255
|
if (association.associationType === "HasOne") {
|
|
256
256
|
delete updateValues[association.foreignKey];
|
|
257
257
|
}
|
|
258
|
-
await instance2.update(updateValues, { ...options, transaction,
|
|
258
|
+
await instance2.update(updateValues, { ...options, transaction, inputValues: updateValues });
|
|
259
259
|
}
|
|
260
260
|
await updateAssociations(instance2, value, {
|
|
261
261
|
...options,
|
|
@@ -271,7 +271,7 @@ async function updateSingleAssociation(model, key, value, options = {}) {
|
|
|
271
271
|
values: value,
|
|
272
272
|
operation: "create"
|
|
273
273
|
});
|
|
274
|
-
const instance = await model[createAccessor](value, { context, transaction,
|
|
274
|
+
const instance = await model[createAccessor](value, { context, transaction, inputValues: value });
|
|
275
275
|
await updateAssociations(instance, value, {
|
|
276
276
|
...options,
|
|
277
277
|
transaction,
|
|
@@ -365,7 +365,7 @@ async function updateMultipleAssociation(model, key, value, options = {}) {
|
|
|
365
365
|
values: item,
|
|
366
366
|
operation: "create"
|
|
367
367
|
});
|
|
368
|
-
const instance = await model[createAccessor](item, accessorOptions);
|
|
368
|
+
const instance = await model[createAccessor](item, { ...accessorOptions, inputValues: item });
|
|
369
369
|
await updateAssociations(instance, item, {
|
|
370
370
|
...options,
|
|
371
371
|
transaction,
|
|
@@ -386,7 +386,7 @@ async function updateMultipleAssociation(model, key, value, options = {}) {
|
|
|
386
386
|
values: item,
|
|
387
387
|
operation: "create"
|
|
388
388
|
});
|
|
389
|
-
instance = await model[createAccessor](item, accessorOptions);
|
|
389
|
+
instance = await model[createAccessor](item, { ...accessorOptions, inputValues: item });
|
|
390
390
|
await updateAssociations(instance, item, {
|
|
391
391
|
...options,
|
|
392
392
|
transaction,
|
|
@@ -409,7 +409,7 @@ async function updateMultipleAssociation(model, key, value, options = {}) {
|
|
|
409
409
|
values: item,
|
|
410
410
|
operation: "update"
|
|
411
411
|
});
|
|
412
|
-
await instance.update(item, { ...options, transaction });
|
|
412
|
+
await instance.update(item, { ...options, transaction, inputValues: item });
|
|
413
413
|
}
|
|
414
414
|
await updateAssociations(instance, item, {
|
|
415
415
|
...options,
|
|
@@ -39,7 +39,7 @@ const postgres = {
|
|
|
39
39
|
name: "string",
|
|
40
40
|
smallint: ["integer", "sort"],
|
|
41
41
|
integer: ["integer", "unixTimestamp", "sort"],
|
|
42
|
-
bigint: ["bigInt", "unixTimestamp", "sort"],
|
|
42
|
+
bigint: ["bigInt", "snowflakeId", "unixTimestamp", "sort"],
|
|
43
43
|
decimal: "decimal",
|
|
44
44
|
numeric: "float",
|
|
45
45
|
real: "float",
|
|
@@ -77,7 +77,7 @@ const mysql = {
|
|
|
77
77
|
int: ["integer", "unixTimestamp", "sort"],
|
|
78
78
|
"int unsigned": ["integer", "unixTimestamp", "sort"],
|
|
79
79
|
integer: ["integer", "unixTimestamp", "sort"],
|
|
80
|
-
bigint: ["bigInt", "unixTimestamp", "sort"],
|
|
80
|
+
bigint: ["bigInt", "snowflakeId", "unixTimestamp", "sort"],
|
|
81
81
|
"bigint unsigned": ["bigInt", "unixTimestamp", "sort"],
|
|
82
82
|
float: "float",
|
|
83
83
|
double: "float",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "2.0.0-alpha.
|
|
10
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
9
|
+
"@nocobase/logger": "2.0.0-alpha.49",
|
|
10
|
+
"@nocobase/utils": "2.0.0-alpha.49",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
40
40
|
"directory": "packages/database"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "99f71bc8961da62a761630b3eae11092a4372e3e"
|
|
43
43
|
}
|