Closed haplo closed 1 year ago
Just want to confirm — will this work correctly on databases with multiple users? Dynamic defaults
combined with unique constraints always make me nervous. :)
Just want to confirm — will this work correctly on databases with multiple users? Dynamic
defaults
combined with unique constraints always make me nervous. :)
Ah, I don't know, I haven't tested it on a live multi-user deploy.
I was checking the referenced commit and noticed that there is already a migration adding the User.api_token
field, so why would Django be trying to alter it again? There might be something fishy going on, let me research it a bit.
Migration was edited manually in c34388e6c9d08f7974f36407444716f07c79dc5b. Default value was removed from migration but it is present in model. I think that's why Django generated new migration. Default value for api token is 32 long random string and it shouldn't cause problems with multiple users. On the other hand, most users won't use api token so it may be a good idea to keep it disabled by default. In that case default value should be removed from model.
I was working on #215 and noticed that
manage.py makemigrations
was picking up a change forUser.api_token
. It looks like it was added in commit 787ce1775f5bd5699.