seed:run completes successfully but there is no added rows.
See original GitHub issueHey,
I’m migrating my seeding from sequelize (which currently works) to this package. I’m a bit confused here, I’m running the following seeder on a docker migration container. There is another container that also connects to typeorm which works fine, this is the main connection where all the app work is done. I assume you can have multiple typeorm connections active at once, anyways so the seed:run completes without any indication of failure but there are no rows added.

Here’s my ormconfig.js
module.exports = {
type: 'postgres',
port: 5432,
database: process.env.DATABASE_DB,
username: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
host: process.env.DATABASE_HOST,
synchronize: true,
logging: false,
entities: ['../graphql/src/orm/models/artist.ts'],
// "migrations": [
// "src/migration/**/*.ts"
// ],
// "subscribers": [
// "src/subscriber/**/*.ts"
// ]
seeds: ['src/seeds/*{.ts,.js}'],
// "factories": ['src/factories/**/*{.ts,.js}'],
};
Heres the seeder I’m running.
import { Factory, Seeder } from 'typeorm-seeding';
import { Connection } from 'typeorm';
import { Artist } from '../../graphql/src/orm/models';
export default class CreateUsers implements Seeder {
public async run(factory: Factory, connection: Connection): Promise<any> {
await connection
.createQueryBuilder()
.insert()
.into(Artist)
.values([
{
id: '0b600e0a-96d0-4ec0-bc94-2587a6b3507a',
name: 'Various Artists',
description: '',
profileImageStoragePathLarge:
'test',
profileImageStoragePathSmall:
'test',
profileImageStoragePathThumb:
'test',
profileImageUrlLarge:
'test',
profileImageUrlSmall:
'test',
profileImageUrlThumb:
'test',
createdAt: new Date(),
updatedAt: new Date(),
followers: 0,
},
])
.execute();
}
}
How can the seed complete sucessfully but there be no rows?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:13
Top Results From Across the Web
A serious question about a run - Forum - Tetris 2 (NES)
Hello, I am not a speedrunner of this game at all but having tried it myself a month or two back I figured...
Read more >The Return Of The King (How The Speedrun Ended 2.0 #1)
Returning to GTA 5 Speedrunning after over 2 years away. Long past are my days of having all the Grand Theft Auto 5...
Read more >Kirby and the Forgotten Land Any% Speedrun in 1:42:30 ...
We reclaimed the Any% speedrun world record for Kirby and the Forgotten Land! This run was NUTS. This is about as good as...
Read more >Left 4 Dead 2's Insanely Lucky Speedrun World Record
Left 4 Dead 2 has many speedruns and they are all extremely luck based but there is one world record for dark canival...
Read more >Speedrun of Dishonored (SPEEDRUN EXPLAINED - Any%)
15:47 - When seeker interacts with the door to enter this area, he is sure not to spam F to interact. If he...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had a the same problem and debugged it by using the default folder structure
src/seeds/..andsrc/factories/..withormconfig.jsbeingas in the guides. There i saw the CLI actually working: When the CLI recognizes seed files like
add-users.seed.ts, you seein the log. Turns out i had a typo in my custom seed path property in my
ormconfig.jsfile.Just fyi that @malteneuss is correct, but this package should say if it cannot locate any seed files instead of displaying
Finished Seedingwhen it didn’t find anything to seed:One might think that it was able to locate the files and just didn’t log them individually.