@golee/migrations-nest
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Migrations

Below an example of how to configure two migrations scripts (order matters) and their dependencies.

MigrationsModule.forRoot({
    mongoDbConnectionName: 'monogoose_connection_name', // If not specified will use the default connection
	scripts: [
		{
			provide: 'MigrationExample1',
			useFactory: (repo: Repo) => {
				return new MigrationExample1(repo);
			},
			inject: [Repo],
		},
		{
			provide: 'MigrationExample2',
			useFactory: (providerx: ProviderX) => {
				return new MigrateDeletedGeorgianClubs(providerx);
			},
			inject: [ProviderX],
		},
	],
	imports: [
		XModule,
		MongooseModule.forFeature([{ name: 'XModel', schema: XModel, collection: 'xmodels' }]),
	],
})

Readme

Keywords

none

Package Sidebar

Install

npm i @golee/migrations-nest

Weekly Downloads

169

Version

1.0.1

License

Apache-2.0

Unpacked Size

79.6 kB

Total Files

65

Last publish

Collaborators

  • oscargabellini
  • alinianitchii
  • admingolee
  • gtoselli
  • robygolee
  • dodo_golee
  • lucagiovegolee