Skip to content

Commit

Permalink
[Docs] Add warning about using application code in block migrations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyomair authored Dec 5, 2023
1 parent 5594f31 commit b78d7d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/docs/blocks/block-migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ export class ChangeEyebrowMigration extends BlockMigration<(from: From) => To> i
}
```

:::caution
Avoid using application code in the migration.
Doing so prevents the need to adapt old migrations if the code changes at a later time.
:::

Finally, we add the migration to the block using the `migrate` option in `createBlock`.

```ts
Expand Down

0 comments on commit b78d7d5

Please sign in to comment.