From c7b0ea28b233ea70bed6a87e46f5b85701647974 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 13 Mar 2020 22:55:12 +0100 Subject: [PATCH] Hackfix CKAN support for PostgreSQL 12 --- lxc-apps/ckan/ckan.image | 4 ++++ lxc-apps/ckan/install.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lxc-apps/ckan/ckan.image b/lxc-apps/ckan/ckan.image index 22bfb99..dbe2db1 100644 --- a/lxc-apps/ckan/ckan.image +++ b/lxc-apps/ckan/ckan.image @@ -28,6 +28,10 @@ RUN EOF pip install -r /srv/ckan/src/ckanext-geoview/pip-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 addgroup -S -g 8080 ckan adduser -S -u 8080 -h /srv/ckan -s /bin/false -g ckan -G ckan ckan diff --git a/lxc-apps/ckan/install.sh b/lxc-apps/ckan/install.sh index 3405208..23f0ae6 100755 --- a/lxc-apps/ckan/install.sh +++ b/lxc-apps/ckan/install.sh @@ -67,7 +67,7 @@ chown -R 108080:108080 ${CKAN_DATA} # Populate database 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=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 export CKAN_ADMIN_USER="admin"