Journal‎ > ‎

database need to be updated to support tweets with emogi

posted Nov 28, 2014, 3:28 PM by Tarek Hoteit
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
ALTER DATABASE finsentimentdb CHARACTER SET = utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE finsentimentdb.twitterSentiment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE twitterSentiment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE twitterSentiment_twittertext CHANGE twitter_text twitter_text varchar(1024)  CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;

update settings.py
DATABASES = {
    ’default’: {
        ’ENGINE’: ’django.db.backends.mysql’,
        ’NAME’: ’example’,
        ’USER’: ’example’,
        ’PASSWORD’: ’example’,
        ’HOST’: ’’,
        ’PORT’: ’’,
        ’OPTIONS’: {’charset’: ’utf8mb4’},
    }
}

from http://blog.manbolo.com/2014/03/31/using-emojis-in-django-model-fields

Comments