Skip to content

Commit

Permalink
docs(sql): minor fix to auto loading models (sequelize)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Feb 13, 2020
1 parent 6688bc7 commit c082b90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/techniques/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ export class User extends Model<User> {
#### Auto-load models

Manually adding models to the `models` array of the connection options can be tedious. In addition, referencing models from the root module breaks application domain boundaries and causes leaking implementation details to other parts of the application. To solve this issue, automatically load models by setting the `autoLoadModels` property of the configuration object (passed into the `forRoot()` method) to `true`, as shown below:
Manually adding models to the `models` array of the connection options can be tedious. In addition, referencing models from the root module breaks application domain boundaries and causes leaking implementation details to other parts of the application. To solve this issue, automatically load models by setting both `autoLoadModels` and `synchronize` properties of the configuration object (passed into the `forRoot()` method) to `true`, as shown below:

```typescript
@@filename(app.module)
Expand All @@ -977,6 +977,7 @@ import { SequelizeModule } from '@nestjs/sequelize';
SequelizeModule.forRoot({
...
autoLoadModels: true,
synchronize: true,
}),
],
})
Expand Down

0 comments on commit c082b90

Please sign in to comment.