From 200f2f9c7b16307595b5f933aa5c381c27767284 Mon Sep 17 00:00:00 2001 From: David Matejka Date: Thu, 26 Oct 2023 14:29:57 +0200 Subject: [PATCH] feat: add content migrations, restructurize migrations --- docs/guides/acl-definition.md | 2 +- docs/intro/actions.mdx | 4 +- docs/intro/glossary.md | 20 +- docs/intro/introduction.mdx | 2 +- docs/intro/quickstart.mdx | 2 +- docs/reference/cli.md | 2 +- docs/reference/engine/actions/definition.md | 2 +- .../advanced/development-commands.md | 62 ++++ .../advanced/skipping-validations.md | 56 ++++ .../advanced/writing-schema-migrations.md | 112 +++++++ docs/reference/engine/migrations/basics.md | 55 ++++ .../engine/migrations/content-migrations.md | 156 ++++++++++ docs/reference/engine/migrations/overview.md | 47 +++ docs/reference/engine/schema/migrations.md | 294 ------------------ docs/reference/engine/schema/overview.md | 2 +- docs/starter-kits/headless-cms.mdx | 4 +- sidebars.js | 20 +- 17 files changed, 527 insertions(+), 315 deletions(-) create mode 100644 docs/reference/engine/migrations/advanced/development-commands.md create mode 100644 docs/reference/engine/migrations/advanced/skipping-validations.md create mode 100644 docs/reference/engine/migrations/advanced/writing-schema-migrations.md create mode 100644 docs/reference/engine/migrations/basics.md create mode 100644 docs/reference/engine/migrations/content-migrations.md create mode 100644 docs/reference/engine/migrations/overview.md delete mode 100644 docs/reference/engine/schema/migrations.md diff --git a/docs/guides/acl-definition.md b/docs/guides/acl-definition.md index 494e1131..b5aa82aa 100644 --- a/docs/guides/acl-definition.md +++ b/docs/guides/acl-definition.md @@ -93,7 +93,7 @@ export class Comment { As you can see, you can traverse through relations. Our definition says, that `moderator` can update fields `hiddenAt` and `content` of any `Comment` of an `Article` in a `Category` defined in `categoryId` variable. :::note migrations -Don't forget to [create a migration](/reference/engine/schema/migrations.md) to apply changes: +Don't forget to [create a migration](/reference/engine/migrations/basics.md) to apply changes: ```bash npm run contember migrations:diff my-blog setup-acl ``` diff --git a/docs/intro/actions.mdx b/docs/intro/actions.mdx index a12d4aa0..ea485a1e 100644 --- a/docs/intro/actions.mdx +++ b/docs/intro/actions.mdx @@ -38,7 +38,7 @@ Before this can work, though, you'll need to apply the changes using migrations. npm run contember migrations:diff "my-first-action" ``` -(Learn more about [schema migrations](/reference/engine/schema/migrations.md)) +(Learn more about [migrations](/reference/engine/migrations/overview.md)) That's all there is to the Contember setup. To test this locally, refer to our [guide to Actions](/reference/engine/actions/overview). If you're using Contember Cloud, you'll need to enable Actions for your project in the interface. @@ -69,4 +69,4 @@ The next step is to use this payload for your specific needs. In our case, we wa

Quick tutorial on how to quickly use Action with Superface AI.

- \ No newline at end of file + diff --git a/docs/intro/glossary.md b/docs/intro/glossary.md index 4a8d98b0..0dc8fbc1 100644 --- a/docs/intro/glossary.md +++ b/docs/intro/glossary.md @@ -17,16 +17,16 @@ title: Glossary ## Advanced -| Term | Definition | -| ----------------------- | ----------- | -| Workspace | Your (git) repository with one or more Contember projects. | -| [Content API](/reference/engine/content/overview.md) | This is the primary GraphQL API for your project, which is automatically generated from your schema definition. | -| System API | This is a supplementary API for your project. It's primarily used to manage schema migrations. You need it only in really advanced usecases. | -| [Tenant API](/reference/engine/tenant/overview.md) | This API allows you to manage users, API keys, and project memberships on an instance. | -| [Project Schema](/reference/engine/schema/overview.md) | This is the definition of your model, ACL rules, and input validation rules. | -| [Project Schema Migrations](/reference/engine/schema/migrations.md) | These are chronologically sorted, immutable JSON files that contain all schema changes. They serve as the source of truth for a schema. | -| Event | Every operation performed on your data is stored in an event log. This log can be utilized to track history. | -| Superadmin | This is a special user role within Contember. The Superadmin has the highest level of system access and control. | +| Term | Definition | +|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| +| Workspace | Your (git) repository with one or more Contember projects. | +| [Content API](/reference/engine/content/overview.md) | This is the primary GraphQL API for your project, which is automatically generated from your schema definition. | +| System API | This is a supplementary API for your project. It's primarily used to manage schema migrations. You need it only in really advanced usecases. | +| [Tenant API](/reference/engine/tenant/overview.md) | This API allows you to manage users, API keys, and project memberships on an instance. | +| [Project Schema](/reference/engine/schema/overview.md) | This is the definition of your model, ACL rules, and input validation rules. | +| [Project Migrations](/reference/engine/migrations/overview.md) | These are chronologically sorted, files that contain all schema or content changes. They serve as the source of truth for a schema. | +| Event | Every operation performed on your data is stored in an event log. This log can be utilized to track history. | +| Superadmin | This is a special user role within Contember. The Superadmin has the highest level of system access and control. |