Comments (6)
First of all, thank you for replying !
OK, as far as I understand when you set seedTracking to true it allows you to run the same seed multiple times.
Actually my issue is different.
Let me give you an example scenario.
I have two different files:
- microserviceASeeds.ts
- microserviceBSeeds.ts
microserviceASeeds has seeds for EntityA.
microserviceBSeeds has seeds for EntityA again, and EntityB. (they are test data)
With current implementation of typeorm-extension, running this seeds using seed:run cli command, fails because 'checkForDuplicates' throws exception.
Is it possible to skip the checkForDuplicates validation in seed:run ? By providing another cli flag, maybe it can be named 'allowDuplicateEntities' ?
Thanks again.
from typeorm-extension.
Strange. It can only be a duplicate if the class name is the same. That is everything, the checkDuplicates function ensures and that should also never happen.
Could you provide a minimal reproduction repo?
from typeorm-extension.
Yes sir, you are correct. :)
It was indeed my issue, I had duplicate class names by mistake.
Thanks again for your time and very fast response !
from typeorm-extension.
It is possible to define that a seeder is only executed once.
This can either be set globally using the seedTacking option or locally using the track property of a seeder class.
You are very welcome.
By default, you should be able to execute a seeer mulitple times.
from typeorm-extension.
You are welcome!
When you set seedTracking to true, the seeder will not be executed more than once.
Ah now I get the problem. Your seeder class name might be the same, what shouldn't be the case
from typeorm-extension.
The seeder class names are different.
It is the entities used in the seeders that might be the same, at least that is my scenario.
One entity class might be used in multiple seeders.
Hope it is clear.
from typeorm-extension.
Related Issues (20)
- Bug: impossible to run only one seeder HOT 1
- Bug: cannot drop the currently open database HOT 2
- Feature: npm/yarn workspace support HOT 1
- Bug: Unable to resolve TypeORM decorators (suspect workspace issue) HOT 4
- Feature: Rollback seeders HOT 3
- Bug: runSeeders throws with: The "path" argument is undefined HOT 9
- Feature: Async DataSource options for seeding HOT 6
- Bug: async datasource is not supported HOT 2
- Bug: Duplicate shebang lines in v3.1.0 HOT 1
- Bug: TypeError: ctx.constructor is not a constructor HOT 4
- Bug: Can't run cli HOT 4
- Bug: Undefined in DataSource variables HOT 1
- Allow exposing typeorm-extension cli through a bin command HOT 4
- Bug: OptionsError: The database options could not be located/loaded. HOT 16
- Feature: Is there a way this package can work Nest.js? I have tried to work around it and I haven't found the solution yet. HOT 3
- Bug: Cannot find module './cli.cjs' HOT 8
- Bug: OptionsError: The database options could not be located/loaded. HOT 3
- Bug: typeorm-extension: seed:run Not Executing Specific Seed File (Version 3.5.0) HOT 9
- Bug: cannot pass in relative path of data source when running db:create
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeorm-extension.