Skip to content

can't run seeders #4

Description

@mossaabzaroui

Hello,

I have succeded to run migrations from the migrations-compiled-path but for seeders there is no option like seeders-compiled-path and seeders-source-path.
i have create a seed file with this: command :
/var/www/project/src/node_modules/.bin/sequelize seed:generate --name test
=>
seeders folder at "/var/www/project/src/entities/seeders" already exists.
New seed was created at /var/www/project/src/entities/seeders/20180316084809-test.ts .

When i run db:seed:all i have this error :
File: 20180316084809-test.ts does not match pattern: /.js$/
No seeders found.

Here is my .sequelizerc file :
module.exports = {
'config': path.resolve('src', 'entities/database.ts'),
'models-path': path.resolve('src', 'entities'),
'seeders-path': path.resolve('src', 'entities/seeders'),
'migrations-source-path': path.resolve('src', 'entities/migrations'),
'migrations-compiled-path': path.resolve('dist', 'entities/migrations')
}

It works fine for migrations but not seeders.
@douglas-treadwell do you have an idea how i can fix this ?

Thank you.

Activity

  1. Befkadu1 commented on Mar 31, 2019

    @Befkadu1

    You probably need to change 20180316084809-test.ts to 20180316084809-test.js

  2. himanshugogroup commented on Feb 6, 2024

    @himanshugogroup

    First add seeder text in file name and second compile project to js eg; npx tsc -outDir ./build-migrations ./src/**/*.ts

    Don't forget to exclude build-migrations as it only will be used while migration/seed running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions