Originally posted by **wyknmjj** March 22, 2023
I added a new table in initDB and increased the version number by 1. The table was successfully created, but I couldn't add any data to it, and reported a
```js
{
"message": "Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path yielded a value that is not a valid key.",
"type": "DataError"
}
```
error.
Or I changed the table I added in initDB to alter, the table can be successfully created, but the generated table structure is different from the initialized structure.
![image](https://user-images.githubusercontent.com/92901171/226890698-77674629-6510-4d6c-91a4-c22c18b77004.png)
The code in alter mode is like this
```js
{
name: tableChatName,
columns: {
},
alter: {
2: {
drop: {
},
modify: {
id: {
primaryKey: true,
autoIncrement: true
},
content: {
notNull: true,
dataType: DATA_TYPE.String
},
createTime: {
notNull: true,
dataType: DATA_TYPE.DateTime
}
},
add: {
}
}
}
}
```
Discussed in https://github.com/ujjwalguptaofficial/JsStore/discussions/317