Skip to content

Support rename_attribute #171

@graft

Description

@graft

If we want to change the name of an existing attribute, we need to rename the column. In the future we might decouple these things; the data table column name could be added to the attributes table, so that the reference to the column is independent of the name of the attribute. However, currently the attribute associates with the column strictly by name.

To support rename_attribute we need only:

  1. change the entry in the attributes table
  2. update the Magma::Model.attributes
  3. Migrate the column to its new name.

Since we're fortunately not changing the type of the column or even removing the column from the model, the data itself remains intact throughout and is still associated in the same place. Therefore this action is not actually destructive and we don't need to do anything else.

Here we should only have to validate (after correctly finding the attribute) that new_attribute_name is in snake_case and doesn't collide with an existing attribute.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions