tduniec / backstage-timesaver-plugin

This plugin provides an implementation of charts and statistics related to your time savings that are coming from usage of your templates. Plugins is built from frontend and backend part. This part of plugin `frontend` is responsible of providing views with charts describing data collected from `backend` part of plugin.
Apache License 2.0
20 stars 6 forks source link

migrate functionality throwing error #7

Closed jsidney closed 9 months ago

jsidney commented 9 months ago

Hi there @tduniec. I am trying to add some functionality to run the backwards migration on some of our templates. So far I am trying it locally (I do have a local postgres db running). the plugin versions are:

"@tduniec/backstage-plugin-time-saver-backend": "^0.1.7",
"@tduniec/backstage-plugin-time-saver-common": "^0.1.0",
"@tduniec/backstage-plugin-time-saver": "^0.1.6-0",

and my app-config looks like:

ts:
  backward:
    config: |
      [
        {
          "entityRef": "template:default/example-nodejs-template",
          "engineering": {
            "cloud-enablement": 8
          }
        }
      ]

when I run the /migrate API call, the following is the error:

[1] 2024-02-27T10:42:54.100Z timesaver error Error selecting data:
[1]             select spec from scaffolder.tasks where id=$1
[1]              - relation "scaffolder.tasks" does not exist type=plugin length=115 name=error severity=ERROR code=42P01 detail=undefined hint=undefined position=31 internalPosition=undefined internalQuery=undefined where=undefined schema=undefined table=undefined column=undefined dataType=undefined constraint=undefined file=parse_relation.c line=1170 routine=parserOpenTable stack=error:
[1]             select spec from scaffolder.tasks where id=$1
[1]              - relation "scaffolder.tasks" does not exist
.....
[1] 2024-02-27T10:42:54.101Z timesaver error problem with template backward migration
[1]             select spec from scaffolder.tasks where id=$1
[1]              - relation "scaffolder.tasks" does not exist type=plugin length=115 name=error severity=ERROR code=42P01 detail=undefined hint=undefined position=31 internalPosition=undefined internalQuery=undefined where=undefined schema=undefined table=undefined column=undefined dataType=undefined constraint=undefined file=parse_relation.c line=1170 routine=parserOpenTable stack=error:
[1]             select spec from scaffolder.tasks where id=$1
[1]              - relation "scaffolder.tasks" does not exist

any suggestions as to what might be going wrong?

tduniec commented 9 months ago

Hey @jsidney,

Please use latest backend version, it should resolve your issue. For now I have released it as prepatch

https://www.npmjs.com/package/@tduniec/backstage-plugin-time-saver-backend/v/0.1.8-0

0.1.8-0

jsidney commented 9 months ago

thank you for that insight @tduniec :) it worked like a charm 💪