powa-team / powa-web

PoWA user interface
http://powa.readthedocs.io/
73 stars 31 forks source link

Version 4.1.0 alter extension powa update ERROR: column "last_present_ts" of relation "powa_statements" already exists #121

Closed banlex73 closed 3 years ago

banlex73 commented 3 years ago

Somehow I already had that column in my table. Fixed: alter table powa_statements drop column last_present_ts; alter extension powa update;

I suspect a bug in powa--4.0.1--4.1.0.sql should use ALTER TABLE public.powa_statements ADD if not exists last_present_ts timestamptz NULL DEFAULT now();

rjuju commented 3 years ago

The last_present_ts column didn't exist in version 4.0.1, so the upgrade script as-is should work. Maybe you added this column manually and modified the purge function manually when working on https://github.com/powa-team/powa-archivist/pull/32?

I don't think that the upgrade script should try to detect direct modification of the tables.

banlex73 commented 3 years ago

Thank you Julien Yes, Most likely I added that column manually when working on powa-team/powa-archivist#32 https://github.com/powa-team/powa-archivist/pull/32 adding IF NOT EXISTS just a suggestion, it's up to you.

thank you Andriy

нд, 13 груд. 2020 о 18:27 Julien Rouhaud notifications@github.com пише:

The last_present_ts column didn't exist in version 4.0.1, so the upgrade script as-is should work. Maybe you added this column manually and modified the purge function manually when working on powa-team/powa-archivist#32 https://github.com/powa-team/powa-archivist/pull/32?

I don't think that the upgrade script should try to detect direct modification of the tables.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/powa-team/powa-web/issues/121#issuecomment-744126823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHWEYEN5OW2GSANA5JZIRDSUVZ2JANCNFSM4UZ7R47A .