Rename Column
The renamecolumn method allows you to change the name of an existing column.
Usage
To rename a column, use the renamecolumn key inside an altertable definition. Provide an object where each key is the old column name and its value is the new column name.
{
"_id": "1.5.0",
"altertable": {
"users": {
"renamecolumn": {
"user_nickname": "username",
"signup_date": "created_at"
}
}
}
}In this example:
- The
user_nicknamecolumn will be renamed tousername. - The
signup_datecolumn will be renamed tocreated_at.