Skip to main content

Schema type change from object to a view

Changing a schema from object type to view type does not require a migration document.

The original object entity is renamed following a similar pattern to post-migration properties.

For example, given this initial schema:

MySchema:
type: object
version: 1

The following updated schema:

MySchema:
type: view
version: 2
sql: SELECT etc

Then after a successful migration with migration id m1, there will be a new view called:

MySchema

and the old object table will be renamed to:

__MySchema_m1