docs: added a note about generate command (#2418)

This commit is contained in:
Shahed Nasser
2022-10-11 16:33:21 +03:00
committed by GitHub
parent 8ca9354c50
commit 2ac8d8e979

View File

@@ -16,10 +16,16 @@ The migration file must be inside the `src/migrations` directory. When you run t
:::tip
You can learn more about writing migrations in [Typeorms Documentation](https://typeorm.io/migrations).
You can alternatively use Typeorm's `generate` command to generate a Migration file from existing database tables, which requires setting up a data source in Typeorm. Check out Typeorm's documentation to learn [how to create a data source](https://typeorm.io/data-source#creating-a-new-datasource), then use the [generate command](https://typeorm.io/using-cli#generate-a-migration-from-existing-table-schema).
:::
## Write Migration File
The migration file contains the necessary commands to create the database columns, foreign keys, and more.
You can learn more about writing the migration file in You can learn more about writing migrations in [Typeorms Documentation](https://typeorm.io/migrations).
## Build Files
Before you can run the migrations you need to run the build command to transpile the TypeScript files to JavaScript files: