q-koa 11.8.3 → 11.8.5

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.
@@ -3,13 +3,21 @@ module.exports = {
3
3
  belongs: 'page',
4
4
  multiple: false,
5
5
  availableSort: false,
6
- order: ["created_at"],
7
- select: [{"key":"user_id"},{"key":"nick_name"}],
6
+ order: ['created_at'],
7
+ select: [{ key: 'user_id' }, { key: 'nick_name' }],
8
8
  excludes: [],
9
9
  limit: 20,
10
10
  defaultOrder: [{ sort: 'descending', type: 'id' }],
11
- comment: {"created_at":"创建时间"},
11
+ comment: { created_at: '创建时间' },
12
12
  sortOrder: 1,
13
13
  reference: [],
14
14
  excludeAuth: [],
15
+ indexList: [
16
+ {
17
+ name: 'openid',
18
+ unique: true,
19
+ fields: ['openid'],
20
+ },
21
+ { fields: ['user_id'] },
22
+ ],
15
23
  }
@@ -16,4 +16,12 @@ module.exports = {
16
16
  sortOrder: 1,
17
17
  reference: [],
18
18
  excludeAuth: [],
19
+ indexList: [
20
+ {
21
+ name: 'openid',
22
+ unique: true,
23
+ fields: ['openid'],
24
+ },
25
+ { fields: ['user_id'] },
26
+ ],
19
27
  }
@@ -7,7 +7,7 @@ exports.openid = {
7
7
  is_mock: false,
8
8
  defaultValue: '',
9
9
  sortOrder: 1,
10
- unique: true,
10
+ unique: ['openid'],
11
11
  }
12
12
 
13
13
  exports.user_id = {
@@ -731,7 +731,7 @@ exports.checkIndex = async (ctx) => {
731
731
  ...res,
732
732
  [current]: {
733
733
  isSame,
734
- tableIndexList,
734
+ indexList: tableIndexList.filter((i) => i.name !== 'PRIMARY'),
735
735
  },
736
736
  }
737
737
  }
@@ -751,7 +751,9 @@ exports.checkIndex = async (ctx) => {
751
751
  const isSame = compareIndex(tableIndexList, modelIndexList, model)
752
752
  return ctx.SUCCESS({
753
753
  isSame,
754
- ...(isSame ? {} : { tableIndexList }),
754
+ ...(isSame
755
+ ? {}
756
+ : { indexList: tableIndexList.filter((i) => i.name !== 'PRIMARY') }),
755
757
  })
756
758
  }
757
759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "11.8.3",
3
+ "version": "11.8.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {