@budibase/server 2.5.6-alpha.12 → 2.5.6-alpha.13

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.5.6-alpha.12",
4
+ "version": "2.5.6-alpha.13",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -45,12 +45,12 @@
45
45
  "license": "GPL-3.0",
46
46
  "dependencies": {
47
47
  "@apidevtools/swagger-parser": "10.0.3",
48
- "@budibase/backend-core": "2.5.6-alpha.12",
49
- "@budibase/client": "2.5.6-alpha.12",
50
- "@budibase/pro": "2.5.6-alpha.6",
51
- "@budibase/shared-core": "2.5.6-alpha.12",
52
- "@budibase/string-templates": "2.5.6-alpha.12",
53
- "@budibase/types": "2.5.6-alpha.12",
48
+ "@budibase/backend-core": "2.5.6-alpha.13",
49
+ "@budibase/client": "2.5.6-alpha.13",
50
+ "@budibase/pro": "2.5.6-alpha.12",
51
+ "@budibase/shared-core": "2.5.6-alpha.13",
52
+ "@budibase/string-templates": "2.5.6-alpha.13",
53
+ "@budibase/types": "2.5.6-alpha.13",
54
54
  "@bull-board/api": "3.7.0",
55
55
  "@bull-board/koa": "3.9.4",
56
56
  "@elastic/elasticsearch": "7.10.0",
@@ -176,5 +176,5 @@
176
176
  "optionalDependencies": {
177
177
  "oracledb": "5.3.0"
178
178
  },
179
- "gitHead": "c973b051ea1bec32c3b1200955851e24405e89ea"
179
+ "gitHead": "93481829168c6c8225943dba4e46ad606ca8c4bd"
180
180
  }
@@ -110,19 +110,25 @@ export function importToRows(
110
110
  table: Table,
111
111
  user: ContextUser | null = null
112
112
  ) {
113
+ let originalTable = table
113
114
  let finalData: any = []
114
115
  for (let i = 0; i < data.length; i++) {
115
116
  let row = data[i]
116
117
  row._id = generateRowID(table._id!)
117
118
  row.tableId = table._id
119
+
120
+ // We use a reference to table here and update it after input processing,
121
+ // so that we can auto increment auto IDs in imported data properly
118
122
  const processed = inputProcessing(user, table, row, {
119
123
  noAutoRelationships: true,
120
124
  })
121
125
  row = processed.row
122
126
  table = processed.table
123
127
 
124
- for (const [fieldName, schema] of Object.entries(table.schema)) {
125
- // check whether the options need to be updated for inclusion as part of the data import
128
+ // However here we must reference the original table, as we want to mutate
129
+ // the real schema of the table passed in, not the clone used for
130
+ // incrementing auto IDs
131
+ for (const [fieldName, schema] of Object.entries(originalTable.schema)) {
126
132
  if (
127
133
  (schema.type === FieldTypes.OPTIONS ||
128
134
  schema.type === FieldTypes.ARRAY) &&