Hackfix CKAN support for PostgreSQL 12

This commit is contained in:
Disassembler 2020-03-13 22:55:12 +01:00
parent 0b46076ae7
commit c7b0ea28b2
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,10 @@ RUN EOF
pip install -r /srv/ckan/src/ckanext-geoview/pip-requirements.txt pip install -r /srv/ckan/src/ckanext-geoview/pip-requirements.txt
pip install -r /srv/ckan/src/ckanext-dgvat-xls/requirements.txt pip install -r /srv/ckan/src/ckanext-dgvat-xls/requirements.txt
# Hackfix support for PostgreSQL 12
# https://github.com/sqlalchemy/sqlalchemy/issues/4463
sed -i 's/cons\.consrc/pg_get_constraintdef(cons.oid)/' /usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py
# Create OS user # Create OS user
addgroup -S -g 8080 ckan addgroup -S -g 8080 ckan
adduser -S -u 8080 -h /srv/ckan -s /bin/false -g ckan -G ckan ckan adduser -S -u 8080 -h /srv/ckan -s /bin/false -g ckan -G ckan ckan

View File

@ -67,7 +67,7 @@ chown -R 108080:108080 ${CKAN_DATA}
# Populate database # Populate database
spoc-container exec ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini spoc-container exec ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini
spoc-container exec ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini spoc-container exec ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
spoc-container exec ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan-postgres -- psql spoc-container exec ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | spoc-container exec ckan-postgres -- psql
# Create admin account # Create admin account
export CKAN_ADMIN_USER="admin" export CKAN_ADMIN_USER="admin"