System Information
- Strapi Version: 4.3.4
- Operating System: macOS
- Database: PostgreSQL
- Node Version: 14.20.0
- NPM Version: 6.14.17
- Yarn Version: 1.22.19
How do you write model/database changes for a custom field/component?
Similar to Field Registering - Strapi Developer Docs, I’ve created a new field/component in the admin panel but that’s where it stops, it doesn’t create a new field in the database table.
The field is working properly in the UI, I can see the data before an update. I created a lifecyles.ts file in my content-type
and can see the value before and of course, it doesn’t show it after.
export default {
beforeUpdate: (event) => {
console.log(event.params.data.foo); // Outputs test
},
afterUpdate: (event) => {
console.log(event.result.foo); // Outputs undefined
}
};