docs: document checks examples + migrations naming convention (#13052)

This commit is contained in:
Shahed Nasser
2025-07-25 17:22:37 +03:00
committed by GitHub
parent b40b2ff676
commit 5a01ef89ea
5 changed files with 189 additions and 5 deletions
@@ -37,7 +37,7 @@ You can also write migrations manually. To do that, create a file in the `migrat
For example:
```ts title="src/modules/blog/migrations/Migration202507021059.ts"
```ts title="src/modules/blog/migrations/Migration202507021059_create_author.ts"
import { Migration } from "@mikro-orm/migrations"
export class Migration202507021059 extends Migration {
@@ -63,6 +63,12 @@ Refer to [MikroORM's documentation](https://mikro-orm.io/docs/migrations#migrati
</Note>
### Migration File Naming
Migrations are executed in the ascending order of their file names. So, it's recommended to prefix the migration file name with the timestamp of when the migration was created. This ensures that migrations are executed in the order they were created.
For example, if you create a migration on July 2, 2025, at 10:59 AM, the file name should be `Migration202507021059_create_brand.ts`. This way, the migration will be executed after any previous migrations that were created before this date and time.
---
## Run the Migration