Skip to content

Statistics have hard dependency on Postgres #205

Description

@thet

It looks like the statistics module have a hard dependency on PostgreSQL. There are several occurrences on get_postgres_url throughout the osha.oira code base. This breaks at least some upgrade steps on installations which use sqlite.

image

Example broken upgrade: Add modified and completion percentage columns to survey statistics.

Example of broken upgrade step:

2023-05-12 19:51:44,809 ERROR   [Zope.SiteErrorLog:252][waitress-2] 1683913904.80870720.6203021530749309 http://localhost:9600/Plone/portal_setup/manage_doUpgrades
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 280, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.GenericSetup.tool, line 1135, in manage_doUpgrades
  Module Products.GenericSetup.upgrade, line 185, in doStep
  Module ftw.upgrade.directory.wrapper, line 11, in upgrade_step_wrapper
  Module ftw.upgrade.step, line 60, in __new__
  Module ., line 52, in __call__
  Module osha.oira.upgrade.utils, line 48, in alembic_upgrade_statistics_to
  Module osha.oira.statistics.model, line 27, in get_postgres_url
AttributeError: 'NoneType' object has no attribute 'get'

/cc @reinhardt

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions