Skip to main content

Renaming an object schema

Rename an object schema

To rename an object schema (and maintain the original data), a transformation document must be provided.

For example, given this initial schema:

MySchema:
type: object
version: 1
properties:
field1:
type: string

The following updated schema:

MyNewSchema:
type: object
version: 1
properties:
field1:
type: string

The following migration document:

- target: MyNewSchema
toVersion: 1
source: MySchema
properties: # note: on a rename, it is not necessary to list the properties to be copied unless transforms are needed
field1: field1

Then after migration, all rows in MySchema will be copied to MyNewSchema, and the original schema table will be renamed following the convention above.