django-add-default-value
django-add-default-value copied to clipboard
This django Migration Operation can be used to transfer a Fields default value to the database scheme.
Hi, I am trying to add a new non nullable field on a model in a backward compatible way. I understood clearly what this library achieves, but i am wondering...
I've run into a couple scenarios where allowing the use of a raw string to be used as a default would be useful. For example to call an unsupported function,...
Hi! Thanks a lot for this library. I am trying to use it like this: ```python AddDefaultValue( model_name='mymodel', name='weight', value=None, ), ``` And this happens: ``` .venv/lib/python3.7/site-packages/MySQLdb/connections.py", line 280, in...
Bumps [black](https://github.com/psf/black) from 18.6b4 to 24.3.0. Release notes Sourced from black's releases. 24.3.0 Highlights This release is a milestone: it fixes Black's first CVE security vulnerability. If you run Black...
With 5.0, Django will support setting database defaults: https://docs.djangoproject.com/en/dev/releases/5.0/#database-computed-default-values Perhaps this package can provide support for Django versions up until 4.2. And once the LTS 4.2 is not maintained anymore,...
When using the undocumented `NOW`like so: ``` from django_add_default_value import AddDefaultValue, NOW # .... class Migration(migrations.Migration): operations = [ # ... AddDefaultValue(model_name="mymodel", name="updated_at", value=NOW) # .... ] ``` Generates the...
Dear Sir, How can I set default current timestmp in mySQL? I want to have current timestamp in that field when the record is modilfied I used below code but...