Search code examples
angularsqlitestrapi

Content type update breaks the SQlite database


I have an instance of Strapi on localhost.

I created a "posts" content-type with 3 fields: Title, Description and Thumbnail. I also use Angular for the frontend. I make http request in Angular and I've seen the all the key names in the responses (e.g get posts) so I wanted to change the model for the posts content-type to lowercase. Now this change is breaking the database and I don't know how I can fix this, as long as I cannot run strapi develop or any other command, getting the following errors:

error Impossible to register the 'post' model. error Error: SQLITE_ERROR: duplicate column name: title

I opened the posts model and check if there is any duplicate title field, but there isn't. It's only in the database and I don't know if there is a fix for this, or I have to delete the entire database and create it from skratch.


Solution

  • You will need to open the SQLite database in a DB client (like dbeaver) and manually rename the column as right now Strapi does not do database migrations