Skip to content

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

@nilliams

Description

@nilliams

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions