befly 3.21.1 → 3.22.0

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.
@@ -15,16 +15,16 @@ export const scanSources = async () => {
15
15
  const apis = [];
16
16
  const plugins = [];
17
17
  const hooks = [];
18
- const tables = [];
18
+ const tables = {};
19
19
 
20
20
  // 处理表格
21
21
  const allCoreTables = await scanFiles(coreTableDir, "core", "table", "*.json");
22
22
  for (const item of allCoreTables) {
23
- tables.push(item);
23
+ tables[`befly${item.fileName.charAt(0).toUpperCase()}${item.fileName.slice(1)}`] = item.fieldsDef;
24
24
  }
25
25
  const allAppTables = await scanFiles(appTableDir, "app", "table", "*.json");
26
26
  for (const item of allAppTables) {
27
- tables.push(item);
27
+ tables[item.fileName] = item.fieldsDef;
28
28
  }
29
29
 
30
30
  // 处理插件
@@ -1,26 +0,0 @@
1
- const SYNC_DB_COLUMNS_SQL = `
2
- SELECT
3
- c.TABLE_NAME AS tableName,
4
- t.TABLE_COMMENT AS tableComment,
5
- c.COLUMN_NAME AS columnName,
6
- c.DATA_TYPE AS dataType,
7
- c.COLUMN_TYPE AS columnType,
8
- c.CHARACTER_MAXIMUM_LENGTH AS charLength,
9
- c.COLUMN_COMMENT AS columnComment,
10
- c.ORDINAL_POSITION AS ordinalPosition
11
- FROM information_schema.COLUMNS AS c
12
- LEFT JOIN information_schema.TABLES AS t
13
- ON t.TABLE_SCHEMA = c.TABLE_SCHEMA
14
- AND t.TABLE_NAME = c.TABLE_NAME
15
- WHERE c.TABLE_SCHEMA = DATABASE()
16
- ORDER BY c.TABLE_NAME ASC, c.ORDINAL_POSITION ASC
17
- `;
18
-
19
- export async function querySyncDbColumns(mysql) {
20
- const queryRes = await mysql.execute(SYNC_DB_COLUMNS_SQL);
21
- if (!Array.isArray(queryRes.data)) {
22
- return [];
23
- }
24
-
25
- return queryRes.data;
26
- }