Hi all! I have a production database and i would l...
# orm-help
i
Hi all! I have a production database and i would like to modify a schema addinf another field to it. I've read the documentation, i've found it a little confusing, i'm still a newbie into backend. What would be the best approach, in order to modify a schema in a production database?
r
@Ivan 👋 The best approach would be introducing an optional field. 1. Create an optional field
field String?
2. Apply the migrations The following is only need if you want the field as required 1. Seed data for the optional field 2. Make it required in the schema and apply the migration
i
Thank you! As a command should i use "prisma migrate dev" for applying the migration?
Or should i use "prisma migrate deploy"? but reading the docs i see this "`migrate deploy` should generally be part of an automated CI/CD pipeline, and we do not recommend running this command locally to deploy changes to a production database" so i'm worried because my database is in a production environment
r
Yes
prisma migrate dev
to apply the migrations in the development environment and
migrate deploy
for pipelines.
✅ 1