Kevin Wolf
Kevin Wolf
DTDrizzle Team
Created by Kevin Wolf on 12/9/2024 in #help
Challenges with Drizzle Kit Workflow Using a Single Database for Development and Production
I'm currently employing a single database for both development and production environments, as my project hasn't gone live yet. My workflow is as follows: 1. Develop locally, modifying the schema and executing drizzle-kit push to apply changes directly. 2. Once satisfied with the database structure, run drizzle-kit generate to create migration files. 3. On the remote environment, execute drizzle-kit migrate to apply pending migrations. However, during the drizzle-kit migrate step, I encounter the following error:
applying migrations…error: type “user_role” already exists
applying migrations…error: type “user_role” already exists
This error arises because the user_role type was previously created when I executed drizzle-kit push locally. I'm seeking advice on how to refine my workflow to prevent such conflicts and ensure a smooth migration process across environments. Any suggestions or best practices would be greatly appreciated.
2 replies