Handle changes on components in V4

System Information
  • Strapi Version: 4.1.9
  • Operating System:
  • Database: postgres
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hi awesome people,

I have been using strapi v3 with mongo from last one year and now I am migrating to V4 with postgres. I am able to almost complete the migration for code as well as data. However I have one question related to component changes which is already released and has data.
When I was using V3, I can simply add another field and it was taken care by mongo automatically. e.g. If I have a component with below attribute for which data is already existing on production.

"attributes": {
    "subtext": {
      "type": "string",
      "column": {
        "type": "text"
      },
      "maxLength": 160,
      "required": false
    },
    "image": {
      "type": "media",
      "multiple": false,
      "allowedTypes": ["images"],
      "required": true
    },

Now If I want to add another field like title to this collection, this is breaking because postgres table doesn’t has the title in the schema.

"attributes": {
    "subtext": {
      "type": "string",
      "column": {
        "type": "text"
      },
      "maxLength": 160,
      "required": false
    },
 "title": {
      "type": "string",
      "column": {
        "type": "text"
      },
      "maxLength": 160,
      "required": false
    },
    "image": {
      "type": "media",
      "multiple": false,
      "allowedTypes": ["images"],
      "required": true
    },

Can anyone please suggest how can I handle such cases in strapi v4 with postgres.


@DMehaffy any suggestions?

I’m not sure I understand, we will automatically create the columns for you in v4 as well. Can you give the error that happens?