mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:36:44 +00:00
fix: quote table name when get mysql table define
This commit is contained in:
parent
d37c71aaed
commit
84593b8ff1
@ -91,7 +91,11 @@ export default class MysqlQueryInterface extends QueryInterface {
|
|||||||
async showTableDefinition(tableInfo: TableInfo): Promise<any> {
|
async showTableDefinition(tableInfo: TableInfo): Promise<any> {
|
||||||
const { tableName } = tableInfo;
|
const { tableName } = tableInfo;
|
||||||
|
|
||||||
const sql = `SHOW CREATE TABLE ${tableName}`;
|
//nint quote table name for it may be special word like group
|
||||||
|
let newTableName = tableName;
|
||||||
|
if (!tableName.startsWith('`')) newTableName = this.db.utils.quoteTable(tableName);
|
||||||
|
const sql = `SHOW CREATE TABLE ${newTableName}`;
|
||||||
|
//const sql = `SHOW CREATE TABLE ${tableName}`;
|
||||||
|
|
||||||
const results = await this.db.sequelize.query(sql, { type: 'SELECT' });
|
const results = await this.db.sequelize.query(sql, { type: 'SELECT' });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user