aspiredu / django-safemigrate

Safely run migrations before deployment
MIT License
68 stars 0 forks source link

Run migrations from the Django admin #57

Closed ryanhiebert closed 1 month ago

ryanhiebert commented 1 month ago

We could add a Django admin action to run migrations. I'm not sure exactly what that looks like. This feels potentially dangerous, but also pretty helpful. We can have a permission on our SafeMigration model, now that it exists. We might be able to use the proposed background workers API.

tim-schilling commented 1 month ago

I don't know about this. Allowing app users to completely undo their database from the admin seems wrong.

ryanhiebert commented 1 month ago

I was more thinking for forward migrations, particularly Safe.after_deploy ones that safemigrate won't run because they don't have a delay or because there isn't a good way to run migrations after deployment.

tim-schilling commented 1 month ago

Yes, but if you allow them to migrate forwards, they will need to migrate backwards in cases of trouble.

ryanhiebert commented 1 month ago

I'm not sure that it's something we should actively avoid, but I think there's enough hesitation here that neither of us is excited about this idea.