-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add COLLATE "C" into the database table and column cms_cmsplugin.path.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)')) |