We use sequelize to build database models.
- When generating a new model, need to add the
field
attribute in the migration file and specify underscore case if you in fact want underscore columns in the DB (preferred, seeUser
model) - Add
underscored: true
to model definition as well (seeUser
model)
For new models, migrations, etc. refer to the below info or docs.
npm run migrate
npx sequelize-cli model:generate --name TitleCase --attributes camelCase:string,dateField:date
npx sequelize-cli migration:generate --name migration-skeleton
# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
For detailed explanation on how things work, check out Nuxt.js docs.