Project ID: 20027
Project name: My App
Project repo: https://github.com/crowdbotics-apps/my-app-20027
Due to some changes null -> not null on some fields, django is failing to migrate with following error:
django.db.utils.OperationalError: cannot ALTER TABLE "client_client" because it has pending trigger events
This is due to existing data in the table, I would need a flush on client_client table. Can someone help me? No worries on data loss, we are in testing/development stage.
Hi @radac, thanks for writing in!
Please clarify whether you want to flush just one table, or resetting the whole database will also be OK?
Just the table will be better. So we do not lose user accounts.
Instead of deleting the table’s data you could have the migration set the null fields to an empty string. That way there won’t be any problem changing the field to NOT NULL.
What @Crowdbotics_Dan is proposing is a much cleaner solution, @radac.
Please let me know if you will be able to implement it.
@Crowdbotics_Dan problem is that it deployed to some extent and I get 500 error in django/admin when I try to access change list admin view. Also delete for those entries do not work and they just throw 500 error. I was thinking on this all the way around before sending this message and I concluded that I’m locked out.
@dmitrii.k can you please help me?
@radac, it sounds like the only thing left to do is empty out the
client_client table. I’ll do that for you and let you know in this thread once it’s done.
@radac, I’ve just truncated the
client_client table for you. Let me know if the migration works for you now.
@dmitrii.k another problem arose. currently I’m not able to deploy, more exactly I do not see success deploy message on dashboard. Also changes do not reflect on django admin dashboard.
Hi @sohaib.waheed, please refer to my above comment - Django deployment issue
@dmitrii.k @sohaib.waheed this is fixed, everything is ok currently. We can close this.