edgedb / edgedb-cli

The EdgeDB CLI
https://www.edgedb.com/docs/cli/index
Apache License 2.0
165 stars 23 forks source link

Add hint to `edgedb migrate`/`edgedb migration apply` for the case when user has dev mode migrations and is ready to break out of dev mode #1138

Closed raddevon closed 11 months ago

raddevon commented 12 months ago

When a user has dev mode migrations and tries to apply migrations, we give this error:

edgedb error: Database contains Dev mode migrations.
  Hint: Use `edgedb migrate --dev-mode` or `edgedb watch`

This hint is useful if the user wants to continue in dev mode, but it's more likely that they're running migrate because they're done with dev mode and need to apply proper migrations… they just haven't created a migration yet. Could we either replace this hint with one that reflect the more likely intent of the user or add a hint for that case? (If we add one, I think maybe the new hint should be the first one we present, but I'm open to alternatives.)

Dhghomon commented 11 months ago

Currently working on this. One other item I noticed while doing so is that due to edgedb watch creating migrations in dev mode, and dev mode passing on a true when it comes to quiet output, any migration applied after edgedb watch is over don't show the usual Applied (migration hash) 00001.edgeql type output you usually see.

https://github.com/edgedb/edgedb-cli/blob/master/src/migrations/dev_mode.rs#L211

https://github.com/edgedb/edgedb-cli/blob/master/src/migrations/dev_mode.rs#L237

I'm curious, why is dev mode quiet by default in the first place?