From a42c1fa51396bee2473a6f52fcf228cd65dc7f70 Mon Sep 17 00:00:00 2001 From: Chen Yangjian <252317+cyjake@users.noreply.github.com> Date: Mon, 28 Feb 2022 18:29:13 +0800 Subject: [PATCH] fix: tddl gives misleading information_schema.columns.table_name --- src/realm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/realm.js b/src/realm.js index d32df32c..879d3aa9 100644 --- a/src/realm.js +++ b/src/realm.js @@ -75,7 +75,7 @@ async function loadModels(Spine, models, opts) { const schemaInfo = await Spine.driver.querySchemaInfo(database, tables); for (const model of models) { - const columns = schemaInfo[model.physicTable]; + const columns = schemaInfo[model.physicTable] || schemaInfo[model.table]; if (!model.attributes) initAttributes(model, columns); model.load(columns); Spine.models[model.name] = model;