Database

Cleaning Up The Database

On running the npm run setup command, your DB gets seeded with pre-defined tables for users, pricing, subscriptions, etc.


WARNING: Do not execute these commands if you’re unsure about what you want to do.

If you have used OneMix locally and have a lot of dummy data in the DB that you want to get rid of, you can use npx prisma db push --force-reset


WARNING: Do not execute these commands if you’re unsure about what you want to do.

In case you want to make a few adjustments in the DB structure and you’re okay with losing any existing dummy data, you can make the changes in prisma/schema.prisma file and then run the npx prisma migrate reset command.

This command will:

  • Drop the database

  • Create a new database

  • Apply all migrations

  • Generate the Prisma client

TIP: You might get resource_already_exists error from Stripe on running this command if you haven’t made changes to the products in scripts/config.ts file. You can ignore this.

Last updated