From 8b388b815bb7f8756fda24b62f6ed72c336420bf Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 15 Apr 2024 10:31:24 +0300 Subject: [PATCH] docs: add a section about missing migration name (#7013) --- .../development/entities/migrations/create.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/www/apps/docs/content/development/entities/migrations/create.md b/www/apps/docs/content/development/entities/migrations/create.md index a9ddc42f28..48e344f404 100644 --- a/www/apps/docs/content/development/entities/migrations/create.md +++ b/www/apps/docs/content/development/entities/migrations/create.md @@ -109,11 +109,19 @@ export class AddAuthorsAndPosts1690876698954 implements MigrationInterface { } ``` -:::warning +### Migration Name -If you're copying the code snippet above, make sure to not copy the class name or the `name` attribute in it. Your migration should keep its timestamp. +If the `name` attribute isn't available in the generated migration, an error may occur while running the migration. To avoid this, make sure to add it manually and set its value to the class's name: -::: + + +```ts +export class AddAuthorsAndPosts1690876698954 implements MigrationInterface { + name = "AddAuthorsAndPosts1690876698954" + + // ... +} +``` ---