arachnys / cabot

Self-hosted, easily-deployable monitoring and alerts service - like a lightweight PagerDuty
MIT License
5.59k stars 594 forks source link

Missing columns in postgres DB after cabot upgrade #587

Closed onagorodniuk closed 4 years ago

onagorodniuk commented 6 years ago

After cabot upgrade I faced issue, there were two missing collumns in cabot psql db. They are: cabotapp_instance.runbook_link cabotapp_service.runbook_link

ProgrammingError: column cabotapp_instance.runbook_link does not exist LINE 1: ...verall_status", "cabotapp_instance"."hackpadid", "cabotapp... ^ ProgrammingError: column cabotapp_service.runbook_link does not exist LINE 1: ...overall_status", "cabotapp_service"."hackpadid", "cabotapp.

My installation steps:

sudo python setup.py install ; sudo sh -ac ' . ./conf/production.env; python manage.py migrate --fake-initial' sudo sh -ac ' . ./conf/production.env; python manage.py migrate --run-syncdb'; sudo sh -ac ' . ./conf/production.env; python manage.py migrate' ; sudo sh -ac ' . ./conf/production.env; python manage.py collectstatic --noinput' ; sudo sh -ac ' . ./conf/production.env; python manage.py compress'

I have something missing or it is bug? P.S. I have manualy added those collumns and everything works fine.

Cactusbone commented 6 years ago

I had to run

alter table cabotapp_service add column runbook_link text;
alter table cabotapp_instance add column runbook_link text;
alter table cabotapp_service add column is_public boolean;
alter table cabotapp_statuscheckresult rename column check_id TO status_check_id;
alter table cabotapp_shift add column last_modified timestamp with time zone;
onagorodniuk commented 4 years ago

I had to run

alter table cabotapp_service add column runbook_link text;
alter table cabotapp_instance add column runbook_link text;
alter table cabotapp_service add column is_public boolean;
alter table cabotapp_statuscheckresult rename column check_id TO status_check_id;
alter table cabotapp_shift add column last_modified timestamp with time zone;

Thanks. Closing this.