|
1 | | -Django Add Default Value for PostgreSQL |
2 | | -======================================= |
| 1 | +# Django Add Default Value for PostgreSQL |
3 | 2 |
|
4 | 3 | Django Migration Operation that can be used to transfer a field's default value |
5 | 4 | to the database scheme. |
6 | 5 |
|
7 | 6 | Based on [django-add-default-value](https://github.com/3YOURMIND/django-add-default-value/) by [3YOURMIND](https://github.com/3YOURMIND). This variant drops support for other databases, specifically the Azure ODBC driver which does not support current versions of Django. |
8 | 7 |
|
9 | 8 |
|
10 | | - |
| 9 | +[](https://github.com/Mariana-Tek/django-add-default-value-postgresql/actions?query=workflow%3A%22Python+package%22) |
11 | 10 | [](https://pypi.python.org/pypi/django-add-default-value-postgresql/) |
12 | 11 | [](./LICENSE) |
13 | 12 |
|
14 | | -[](https://github.com/Mariana-Tek/django-add-default-value-postgresql/actions?query=workflow%3A%22Python+package%22) |
15 | | - |
16 | 13 |
|
17 | | - |
18 | | - |
19 | | -Dependencies |
20 | | ------------- |
| 14 | +## Dependencies |
21 | 15 |
|
22 | 16 | * Python 3.6, 3.7, or 3.8 |
23 | 17 | * Django 2.2 or 3.0 |
24 | 18 |
|
25 | 19 |
|
| 20 | +## Installation |
26 | 21 |
|
27 | | - |
28 | | -Installation |
29 | | ------------- |
30 | 22 | `pip install django-add-default-value-postgresql` |
31 | 23 |
|
32 | 24 | You can then use ``AddDefaultValue`` in your migration file to transfer the default |
33 | 25 | values to your database. Afterwards, it's just the usual ``./manage.py migrate``. |
34 | 26 |
|
35 | | -Usage |
36 | | ------ |
| 27 | +## Usage |
37 | 28 |
|
38 | 29 | Add this manually to an autogenerated Migration that adds a new field: |
39 | 30 |
|
@@ -85,9 +76,14 @@ You can test against multiple versions of Django using `tox`. To test across Pyt |
85 | 76 |
|
86 | 77 |
|
87 | 78 |
|
88 | | -License |
89 | | -------- |
| 79 | +## License |
90 | 80 |
|
91 | 81 | ``django-add-default-value-postgresql`` is released under the Apache 2.0 License. |
92 | 82 |
|
| 83 | +### Changes from original source |
93 | 84 |
|
| 85 | +* removed MySQL-related code |
| 86 | +* removed MSSQL-related code |
| 87 | +* added allow_migrate_model check on database_forwards and database_backwards |
| 88 | +* added support for Python 3.7 and 3.8, dropped support for <3.6 |
| 89 | +* added support for Django 2.2 and 3.0, dropped support for <2.2 |
0 commit comments