AtlasOfLivingAustralia / webapi

Atlas Web service API app
https://api.ala.org.au
1 stars 6 forks source link

Review webapi database #24

Open Rita-C opened 4 years ago

Rita-C commented 4 years ago

While working on #22, I found the table relationships need review, [and update]. For instance, FK is stored in web_service_category table compares to the value itself is stored in web_service_output_format table:

createTable(schemaName: "webapi", tableName: "web_service_category") { column(name: "web_service_categories_id", type: "BIGINT") column(name: "category_id", type: "BIGINT") }

createTable(schemaName: "webapi", tableName: "web_service_output_format") { column(name: "web_service_id", type: "BIGINT") column(name: "output_format_string", type: "VARCHAR(255)") }

These resulted (via the admin URLs):

  1. Deleting a Category that linked to Webservices causes FY referential error;
  2. Deleting a Format removed a row in format table, no error in app, but the linked value reminded in web_service_output_format table cannot be displayed when loading up the Webservice in app.