🎃 Spooktacular Halloween Sale! 👻 Get up to 90% Off To Flatlogic Generator Subscription – No Tricks, Just Treats! 😈

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!