leoric 2.2.1 → 2.2.2

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/History.md CHANGED
@@ -1,3 +1,12 @@
1
+ 2.2.2 / 2022-02-28
2
+ ==================
3
+
4
+ ## What's Changed
5
+ * fix: tddl gives misleading information_schema.columns.table_name by @cyjake in https://github.com/cyjake/leoric/pull/284
6
+
7
+
8
+ **Full Changelog**: https://github.com/cyjake/leoric/compare/v2.2.1...v2.2.2
9
+
1
10
  2.2.1 / 2022-02-24
2
11
  ==================
3
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leoric",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "JavaScript Object-relational mapping alchemy",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
package/src/realm.js CHANGED
@@ -75,7 +75,7 @@ async function loadModels(Spine, models, opts) {
75
75
  const schemaInfo = await Spine.driver.querySchemaInfo(database, tables);
76
76
 
77
77
  for (const model of models) {
78
- const columns = schemaInfo[model.physicTable];
78
+ const columns = schemaInfo[model.physicTable] || schemaInfo[model.table];
79
79
  if (!model.attributes) initAttributes(model, columns);
80
80
  model.load(columns);
81
81
  Spine.models[model.name] = model;