Skip to content

Adding new fields columns to an existing model

Boris Mann edited this page Feb 19, 2016 · 2 revisions

If you have previously created a model, you should add a new migration to add new fields / columns to it.

Run the following command to create a new migration:

nodal g:migration ExistingModel

This will create an empty migration, where you can manually add fields / columns, something like:

this.addColumn("location", "city", "string")

See https://github.com/keithwhor/nodal/commit/02c80b44c128db89b685e6c1b67c4cff046db59c -- this has been added