piccolo-orm / piccolo

A fast, user friendly ORM and query builder which supports asyncio.
https://piccolo-orm.com/
MIT License
1.45k stars 91 forks source link

Make migration check usable in a GitHub Action #1124

Open remimd opened 1 week ago

remimd commented 1 week ago

I'd like to be able to use: piccolo migrations check in a GitHub Action. Would it be possible to have an equivalent to the Django command: python manage.py makemigrations --dry-run --check that returns a status other than 0 when there are migrations to generate?

dantownsend commented 1 week ago

I think that's a good idea.

With piccolo migrations check it tells you if any existing migrations haven't run, but it always returns an exit code of 0.

If you want to find out if any changes require a new migration, you need piccolo migrations new all --auto. But then like you say, you don't know if it actually did anything based on the exit code.

We could add a flag to one of these existing commands, or add a new command.