nodal icon indicating copy to clipboard operation
nodal copied to clipboard

Suggestion for updated wiki docs content for 'Adding new fields columns to an existing model'

Open nilliams opened this issue 8 years ago • 0 comments

I can't quite follow what's going on with tags and releases at the moment, so I don't want to jump in and edit the wiki page, if there're people on older versions, but here's a suggested update to this page, as it is currently misleading/out-of-date and I had to read the code to figure out what to do.

If this looks okay I can submit the edit:


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

Run the following command to create a new migration:

nodal g:migration MigrationName --add ExistingModel new_column:type

For example, to add a timestamp column to an existing Event model:

nodal g:migration AddTimestampColumnToEvents --add Event timestamp:datetime

Apply the migration:

nodal db:migrate

nilliams avatar Apr 26 '17 11:04 nilliams