I have to switch a field from simple text to rich text in my strapi project and I’m not sure what are the steps to do so.
I edited the json file of the component and replaces text by blocks in my field and created a migration file containing the following lines
module.exports = {
async up(knex) {
knex.schema
.withSchema("public")
.table("components_my_component", (table) => {
table.dropColumn("text");
table.jsonb("text");
});
},
};
However the migration file does not seems to be runned by strapi and I have the same with or without migration file.
alter column "text" type jsonb using ("text"::jsonb) - invalid input syntax for type json
How to run properly a migration in strapi ?