--
-- Copyright (c) 2024 SUSE LLC
--
-- This software is licensed to you under the GNU General Public License,
-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-- along with this software; if not, see
-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
--

COMMENT ON TABLE CoCoAttestationResult
  IS 'List the Confidential Compute Attestations results performed for each report and system';

COMMENT ON COLUMN CoCoAttestationResult.mgm_id
  IS 'The id of the BRAND_NAME instance that contains this data';
COMMENT ON COLUMN CoCoAttestationResult.report_id
  IS 'The id of the report';
COMMENT ON COLUMN CoCoAttestationResult.result_type_id
  IS 'The id of the result type';
COMMENT ON COLUMN CoCoAttestationResult.result_type
  IS 'The type of the result';
COMMENT ON COLUMN CoCoAttestationResult.result_status
  IS 'The status of the result';
COMMENT ON COLUMN CoCoAttestationResult.description
  IS 'The description of the result';
COMMENT ON COLUMN CoCoAttestationResult.details
  IS 'The details of the performed test';
COMMENT ON COLUMN CoCoAttestationResult.attestation_time
  IS 'The timestamp with the time of the attestation';
COMMENT ON COLUMN CoCoAttestationResult.synced_date
  IS 'The timestamp of when this data was last refreshed.';

ALTER TABLE CoCoAttestationResult
    ADD CONSTRAINT CoCoAttestationResult_report_fkey FOREIGN KEY (mgm_id, report_id) REFERENCES CoCoAttestation(mgm_id, report_id);
