@nocobase/database
Advanced tools
Comparing version 1.4.0-alpha.20240923152933 to 1.4.0-alpha.20240928155737
@@ -67,2 +67,3 @@ /** | ||
var FieldTypes = __toESM(require("./fields")); | ||
var import_helpers = require("./helpers"); | ||
var import_inherited_collection = require("./inherited-collection"); | ||
@@ -364,5 +365,2 @@ var import_inherited_map = __toESM(require("./inherited-map")); | ||
if (options.underscored) { | ||
if (import_lodash.default.get(options, "sortable.scopeKey")) { | ||
options.sortable.scopeKey = (0, import_utils3.snakeCase)(options.sortable.scopeKey); | ||
} | ||
if (import_lodash.default.get(options, "indexes")) { | ||
@@ -666,3 +664,3 @@ options.indexes = options.indexes.map((index) => { | ||
async checkVersion() { | ||
return true; | ||
return process.env.DB_SKIP_VERSION_CHECK === "on" || await (0, import_helpers.checkDatabaseVersion)(this); | ||
} | ||
@@ -669,0 +667,0 @@ /** |
@@ -44,6 +44,12 @@ /** | ||
export declare class DecimalField extends NumberField { | ||
get dataType(): DataTypes.DecimalDataTypeConstructor; | ||
get dataType(): DataTypes.DecimalDataType; | ||
static optionsFromRawType(rawType: string): { | ||
precision: number; | ||
scale: number; | ||
}; | ||
} | ||
export interface DecimalFieldOptions extends BaseColumnFieldOptions { | ||
type: 'decimal'; | ||
precision: number; | ||
scale: number; | ||
} |
@@ -82,4 +82,13 @@ /** | ||
get dataType() { | ||
return import_sequelize.DataTypes.DECIMAL; | ||
return import_sequelize.DataTypes.DECIMAL(this.options.precision, this.options.scale); | ||
} | ||
static optionsFromRawType(rawType) { | ||
const matches = rawType.match(/DECIMAL\((\d+),\s*(\d+)\)/); | ||
if (matches) { | ||
return { | ||
precision: parseInt(matches[1]), | ||
scale: parseInt(matches[2]) | ||
}; | ||
} | ||
} | ||
}; | ||
@@ -86,0 +95,0 @@ __name(_DecimalField, "DecimalField"); |
@@ -160,5 +160,5 @@ /** | ||
if (scopeKey) { | ||
const groups = await this.collection.repository.find({ | ||
attributes: [scopeKey], | ||
group: [scopeKey], | ||
const scopeKeyColumn = this.collection.model.rawAttributes[scopeKey].field; | ||
const groups = await this.collection.model.findAll({ | ||
attributes: [[import_sequelize.Sequelize.fn("DISTINCT", import_sequelize.Sequelize.col(scopeKeyColumn)), scopeKey]], | ||
raw: true, | ||
@@ -165,0 +165,0 @@ transaction |
{ | ||
"name": "@nocobase/database", | ||
"version": "1.4.0-alpha.20240923152933", | ||
"version": "1.4.0-alpha.20240928155737", | ||
"description": "", | ||
@@ -9,4 +9,4 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@nocobase/logger": "1.4.0-alpha.20240923152933", | ||
"@nocobase/utils": "1.4.0-alpha.20240923152933", | ||
"@nocobase/logger": "1.4.0-alpha.20240928155737", | ||
"@nocobase/utils": "1.4.0-alpha.20240928155737", | ||
"async-mutex": "^0.3.2", | ||
@@ -42,3 +42,3 @@ "chalk": "^4.1.1", | ||
}, | ||
"gitHead": "bd1a83a7040a63619a3d39c5b67048fa97a49f5a" | ||
"gitHead": "f2765665126f5e9b5ae01f9ca6e8a151916554b4" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
754502
18750
38
+ Added@nocobase/logger@1.4.0-alpha.20240928155737(transitive)
+ Added@nocobase/utils@1.4.0-alpha.20240928155737(transitive)
- Removed@nocobase/logger@1.4.0-alpha.20240923152933(transitive)
- Removed@nocobase/utils@1.4.0-alpha.20240923152933(transitive)