mirror of
https://github.com/Hopiu/django-watson.git
synced 2026-04-17 11:50:58 +00:00
Another attempt to fix test project MySQL collation settings
This commit is contained in:
parent
b982b607d3
commit
085d37fac7
3 changed files with 1 additions and 7 deletions
|
|
@ -14,7 +14,7 @@ install:
|
|||
- pip install $DJANGO psycopg2 MySQL-python
|
||||
- python setup.py -q install
|
||||
before_script:
|
||||
- mysql -e 'create database test_project charset utf8 collate utf8_general_ci;'
|
||||
- mysql -e 'create database test_project'
|
||||
- psql -c 'create database test_project;' -U postgres
|
||||
script: python src/test_project/manage.py test watson
|
||||
notifications:
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@ DATABASES = {
|
|||
'PASSWORD': os.environ.get("DB_PASSWORD", ""),
|
||||
}
|
||||
}
|
||||
if DATABASES["default"]["ENGINE"] == "django.db.backends.mysql":
|
||||
DATABASES["default"]["OPTIONS"] = {
|
||||
"init_command": "SET storage_engine=INNODB,character_set_connection=utf8,collation_connection=utf8_general_ci",
|
||||
}
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/1.6/topics/i18n/
|
||||
|
|
|
|||
|
|
@ -351,8 +351,6 @@ class MySQLSearchBackend(SearchBackend):
|
|||
))
|
||||
# Change the storage engine to MyISAM.
|
||||
cursor.execute("ALTER TABLE watson_searchentry ENGINE = MyISAM")
|
||||
# Change the collaction to a case-insensitive one.
|
||||
cursor.execute("ALTER TABLE watson_searchentry CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci")
|
||||
# Add the full text indexes.
|
||||
cursor.execute("CREATE FULLTEXT INDEX watson_searchentry_fulltext ON watson_searchentry (title, description, content)")
|
||||
cursor.execute("CREATE FULLTEXT INDEX watson_searchentry_title ON watson_searchentry (title)")
|
||||
|
|
|
|||
Loading…
Reference in a new issue