🚨 Black Friday: 85% OFF Flatlogic Generator! 🚨 Build your custom CRM, ERP, or SaaS app with full code ownership—don’t miss out!

Schema how to add a serial number column with auto update after each data in table

Gravatar

How to make a a table with a field Serial Number so that each data entered will be automatically numbered

User profile image
Eugene Stepnov

Hi,

Thanks for the questions!

You can do this by adding following code to the db model:

serialNumber: { type: Sequelize.INTEGER, autoIncrement: true, },

If you have any other questions, please let us know!