WaspW
Waspβ€’9mo ago
jason

Accidentally cooked my db, start fresh from latest migration?

Hi all, I accidentally cooked my db again lmao, oops..

I had some migrations testing some stuff out, but accidentally really messed it up and deleted migration files by reverting with git, blah blah blah, here I am now, I THOUGHT I fixed it by running "wasp db reset" and doing a new "wasp db migrate-dev", but after changing the schema.prisma again and running "wasp db migrate-dev" again, it was saying:

Could not find the migration file at /srv/web/shelter/app/.wasp/out/db/migrations/20250414202957_video_migration/migration.sql. Please delete the directory or restore the migration file.


Then I removed the empty directories from /srv/web/shelter/app/.wasp/out/db/migrations/ and ran it again, but now:
Error: P3006

Migration `20250415005503_new_init_migration` failed to apply cleanly to the shadow database.
Error:
ERROR: type "UserRole" already exists
   0: sql_schema_connector::validate_migrations
           with namespaces=None
             at schema-engine/connectors/sql-schema-connector/src/lib.rs:335
   1: schema_core::state::DevDiagnostic
             at schema-engine/core/src/state.rs:276



I'd rather just start the db fresh with no migration history, just using the current schema.primsa from my latest git commit. How can I do this?
Was this page helpful?