Skip to content

db seeds not being generated using named function, sqlite, nextjs #8685

Closed

Description

@AlexKMarshall

I've tried to set up a seeding file per the instructions on https://www.prisma.io/docs/guides/database/seed-database

My seed is exporting a named seed function. When I run it, the CLI says that the script runs ok, but the seed function is not getting called.

I have a minimal reproduction at https://github.com/AlexKMarshall/next-prisma-starter/tree/prisma-seeds on the prisma-seeds branch

Activity

  1. added
    bug/1-unconfirmed
    kind/bug
    topic: prisma db seed
    on Aug 12, 2021
  2. Jolg42 commented on Aug 13, 2021

    @Jolg42
    Contributor

    Maybe try to use the "script" approach as a workaround?

  3. Jolg42 commented on Aug 13, 2021

    @Jolg42
    Contributor

    🗒️ We are planning a redesign of db seed (currently planned to be released early September)

    How it will work is that a prisma.seed property in the package.json of your project will be required if you want to use prisma db seed.

    This property is where you will be able to put any command you want to execute your seed script.

    More info/details & how to try it out now in:
    #8732

  4. janpio commented on Sep 9, 2021

    @janpio
    Contributor

    The redesign of db seed was released with Prisma 3. Please try it, this problem should be gone.

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

    bug/1-unconfirmedkind/bugtopic: prisma db seed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions