FreedomCoop / valuenetwork

Fork coming from NRP-Sensorica to use and work for FREEDOM COOP
http://fair.coop
GNU Affero General Public License v3.0
31 stars 12 forks source link

fix staging postgresql encoding #493

Closed bum2 closed 5 years ago

bum2 commented 5 years ago

The encoding-collation of the postgresql db at staging is ascii and should be utf-8. The error comes on migrate: value too long for type character varying refering the symbol field of the Unit model, with just one char, but needs to be a unicode single char. Probably is needed to create again the db...

Xicnet commented 5 years ago

This should be fixed. Please, check and close if applies or bounce back to me.

Just for the record, these were the steps:

sudo -u postgres psql postgres

then in psql console execute sequence of commands:

update pg_database set datallowconn = TRUE where datname = 'template0'; \c template0 update pg_database set datistemplate = FALSE where datname = 'template1'; drop database template1; create database template1 with template = template0 encoding = 'UTF8'; update pg_database set datistemplate = TRUE where datname = 'template1'; \c template1 update pg_database set datallowconn = FALSE where datname = 'template0';

(press Ctrl-D to quit from psql)

on the shell, still as postgres user, did:

postgres pg_dump --encoding utf8 ocpdb -f ocpdb.sql dropdb ocpdb createdb -E utf8 ocpdb psql -f main.sql -d ocpdb

bum2 commented 5 years ago

Thanks! the issue is solved...