Skip to content
Snippets Groups Projects
Commit d867e52d authored by Brian Williams's avatar Brian Williams :two:
Browse files

Change fingerprint to bytea

parent 02400b71
No related branches found
No related tags found
1 merge request!90812Add sbom_sources table and model
......@@ -6,7 +6,7 @@ def change
t.timestamps_with_timezone
t.integer :source_type, null: false, limit: 2
t.jsonb :source, null: false, default: {}
t.text :fingerprint, null: false, limit: 255
t.binary :fingerprint, null: false
end
end
end
......@@ -20564,8 +20564,7 @@ CREATE TABLE sbom_sources (
updated_at timestamp with time zone NOT NULL,
source_type smallint NOT NULL,
source jsonb DEFAULT '{}'::jsonb NOT NULL,
fingerprint text NOT NULL,
CONSTRAINT check_74f01d3506 CHECK ((char_length(fingerprint) <= 255))
fingerprint bytea NOT NULL
);
 
CREATE SEQUENCE sbom_sources_id_seq
......@@ -9,6 +9,6 @@ class Source < ApplicationRecord
validates :source_type, presence: true
validates :source, presence: true, json_schema: { filename: 'sbom_source' }
validates :fingerprint, presence: true, length: { maximum: 255 }
validates :fingerprint, presence: true
end
end
......@@ -13,7 +13,6 @@
it { is_expected.to validate_presence_of(:source_type) }
it { is_expected.to validate_presence_of(:source) }
it { is_expected.to validate_presence_of(:fingerprint) }
it { is_expected.to validate_length_of(:fingerprint).is_at_most(255) }
end
describe 'source validation' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment