Skip to content

Commit

Permalink
Add COLLATE "C" into the database table and column cms_cmsplugin.path.
Browse files Browse the repository at this point in the history
  • Loading branch information
zbohm committed May 24, 2021
1 parent fc3a3cf commit 7f12945
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Bug Fixes:
* Fixed template label nested translation
* Fixed a bug where the fallback page title whould be returned instead of the one from the current language
* Fixed an issue when running migrations on a multi database project
* Add COLLATE "C" into the database table and column cms_cmsplugin.path.

Refactoring and Cleanups:
-------------------------
Expand Down
21 changes: 21 additions & 0 deletions cms/migrations/0023_cms_cmsplugin_path_collage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django.conf import settings
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('cms', '0022_auto_20180620_1551'),
]

operations = []
if settings.DATABASES['default']['ENGINE'] in (
'django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql'):
operations.append(migrations.RunSQL(
'ALTER TABLE cms_cmsplugin ALTER COLUMN path SET DATA TYPE varchar(255) COLLATE "C"'))
elif settings.DATABASES['default']['ENGINE'] == 'django.db.backends.mysql':
operations.append(migrations.RunSQL(
'ALTER TABLE cms_cmsplugin MODIFY path VARCHAR(255) COLLATE ascii_general_ci'))
elif settings.DATABASES['default']['ENGINE'] == 'django.db.backends.oracle':
operations.append(migrations.RunSQL(
'ALTER TABLE cms_cmsplugin MODIFY (path VARCHAR2(255) COLLATE BINARY_CI)'))

0 comments on commit 7f12945

Please sign in to comment.