Ali-Toosi / django-pardakht

Django app for connecting to Iranian payment gateways.
MIT License
15 stars 8 forks source link

Error on migration #2

Closed chalist closed 5 years ago

chalist commented 5 years ago

Error in python manage.py migrate :

$ python manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
pardakht.Payment.token: (mysql.E001) MySQL does not allow unique CharFields to have a max_length > 255.
Ali-Toosi commented 5 years ago

If you're using a MySQL version older than 5.7.7 you should either set on innodb_large_prefix or clone the app and change max_length of token field to 255. It will be fine with Zarinpal but Saman hasn't specifically declared maximum length for tokens in the documents.

If you're using a MySQL version higher than 5.7.7 (which is probably the case) add this line to your project's settings:

SILENCED_SYSTEM_CHECKS = ['mysql.E001']

Please read this answer on stackoverflow for more details on this: https://stackoverflow.com/a/45233653/3313927

chalist commented 5 years ago

Does not work again. I set SILENCED_SYSTEM_CHECKS = ['mysql.E001'] and innodb_large_prefix=1 in my.cnf and again I got this error: django.db.utils.InternalError: (1709, 'Index column size too large. The maximum column size is 767 bytes.')

I cloned the project. Thanks.