fossology / LicenseDb

GNU General Public License v2.0
12 stars 9 forks source link

refactor(obligations): Make separate database tables for classification and type #86

Closed deo002 closed 1 month ago

deo002 commented 1 month ago

Changes

Submitter Checklist

References

GMishx commented 1 month ago

For existing database, these new columns should hold some default values:

LicenseDb/laas -dbname laas -datafile fossology/install/db/licenseRef.json -populatedb true

2024/10/18 10:33:40 LicenseDb/cmd/laas/main.go:53 ERROR: column "obligation_classification_id" of relation "obligations" contains null values (SQLSTATE 23502)
[0.252ms] [rows:0] ALTER TABLE "obligations" ADD "obligation_classification_id" bigint NOT NULL
2024/10/18 10:33:40 Failed to automigrate database: ERROR: column "obligation_classification_id" of relation "obligations" contains null values (SQLSTATE 23502)

Process finished with the exit code 1
GMishx commented 1 month ago

While trying to pass wrong data, the unmarshling failed which printed some text making the overall response invalid json.

can't parse JSON.  Raw result:

{"status":500,"message":"Failed to update license","error":"obligation classification must be one of the following values: GREEN WHITE YELLOW RED","path":"/api/v1/obligations/provide license upstream","timestamp":"2024-10-22T10:56:59+05:30"}{"status":200,"data":[{"topic":null,"type":"RISK","text":null,"classification":"WHITTTE","modifications":null,"comment":null,"active":null,"text_updatable":null,"shortnames":[]}],"paginationmeta":{"resource_count":1}}