Skip to content

Commit

Permalink
Expand Change type docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-farries committed Dec 6, 2024
1 parent 3f37af7 commit 7474187
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/operations/alter_column/change_type.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ description: A change type operation changes the type of a column.
}
```

Use the `up` SQL expression to do data conversion from the old column type to the new type. In the old schema version, the column will have its old data type; in the new version the column will have its new type.

Use the `down` SQL expression to do data conversion in the other direction; from the new data type back to the old.

## Examples

Change the type of the `rating` column on the `reviews` table:

<ExampleSnippet example="18_change_column_type.json" language="json" />

0 comments on commit 7474187

Please sign in to comment.