Database Migration / Deployment Questions

I was also facing the same issue. Now, i have found the reason why it was not updating in the database.

When we start the application, Strapi automatically runs the migrations and commits the changes to the database. Post that due to the schema validation it reverts the migration changes that was applied previously and data of that column is stored with default value(mostly Null).

Steps to overcome the issue:

  1. Create the migration file for renaming the column
  2. In the schema.json file, update the ‘attributes’ in the similar manner of renaming the field name

Migration File:

module.exports = {
  async up(knex) {
    await knex.schema.table('testcontents', table => {
      table.renameColumn('title', 'name');
    });
  },
  async down() {},
};

Schema.json file: