WaspW
Wasp2y ago
Gwaggli

wasp db reset showing help instructions

I am trying to setup a seed function and thus wanted to reset my db.
According to the docs: https://wasp-lang.dev/docs/data-model/backends#running-seed-functions I am supposed to run wasp db reset.
Sadly this only triggers the help call:
MyApp% wasp db reset
USAGE
  wasp db <command> [command-args]

COMMANDS
  start         Alias for `wasp start db`.
  reset         Drops all data and tables from development database and re-applies all migrations.
  seed [name]   Executes a db seed function (specified via app.db.seeds).
                If there are multiple seeds, you can specify a seed to execute by providing its name,
                or if not then you will be asked to provide the name interactively.
  migrate-dev   Ensures dev database corresponds to the current state of schema(entities):
                  - Generates a new migration if there are changes in the schema.
                  - Applies any pending migrations to the database either using the
                    supplied migration name or asking for one.
    OPTIONS:
      --name [migration-name]
      --create-only
  studio        GUI for inspecting your database.

EXAMPLES
  wasp db migrate-dev
  wasp db migrate-dev --name "Added User entity"
  wasp db migrate-dev --create-only
  wasp db studio


Is this a bug or am I being stupid?

I also tested it with a new wasp app. Just set the db: System to PostgreSQL and ran
wasp db migrate-dev
and wasp db reset afterwards. Same outcome.


PS: The code example has some minor issues in the createUser Method:
  1. The variable is named prisma and not prismaClient
  2. The password parameter of the sanitizeAndSerializeProviderData method is named hashedPassword
Entities, Operations and Automatic CRUD together make a high-level interface for working with your app's data. Still, all that data has to live somewhere, so let's see how Wasp deals with databases.
Was this page helpful?