Tento lets you define a schema in TypeScript with metaobject and metafield models.
When you define your schema, it serves as the source of truth for future modifications in queries
and migrations.
Note: Now you can declare schema only in single file.
You can also specify tento.config.ts file for CLI migrations. In the config file you need to specify the path to your schema file. With this configuration, Tento will
read from the schema.ts file and use this information during the migration process.
For more information about the tento.config.ts file and migrations, please check: link.
Metaobject schema declaration
A Metaobject should be defined with at least name, type, fieldDefinitions() fields.
Metafield schema declaration
A Metafield should be defined with at least name, key, type, fieldDefinition() fields.
Example
Once you know the basics, letβs define a schema example for a real project to get a better view and understanding