datocms / cli

Official CLI to interact with DatoCMS projects!
MIT License
7 stars 7 forks source link

Feature request: migration "summary" including a warning about invalid records #9

Closed moritzjacobs closed 1 year ago

moritzjacobs commented 1 year ago

Hi! Since we ran into trouble with this a few times, it would be really cool to see how many records were invalidated by running a migration on the CLI, kind of like this:

Running migration "1668493138_foobar.ts"... done
Successfully run 1 migration scripts

Summary:
- ✨ 12 new records (Post, Category)
- ⚠️ 4 changed records (Post)
- 🚨 5 invalid records (Page)

Thanks for consideration!

matjack1 commented 1 year ago

Hey @moritzjacobs sorry for the delay here, the issue was not noticed before :(

Unfortunately what you are asking is not possible as the validations can take a while to finish and happen asyncronously in the background.

You would need to run a separate script that fetches all the invalid records and check how many you have, but it's not something that we can add automatically at the end of every migration unfortunately :(