1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE certificates (
serial_number bytea NOT NULL,
authority_key_identifier bytea NOT NULL,
ca_label bytea,
status bytea NOT NULL,
reason int,
expiry timestamp,
revoked_at timestamp,
pem bytea NOT NULL,
PRIMARY KEY(serial_number, authority_key_identifier)
);
CREATE TABLE ocsp_responses (
serial_number bytea NOT NULL,
authority_key_identifier bytea NOT NULL,
body bytea NOT NULL,
expiry timestamp,
PRIMARY KEY(serial_number, authority_key_identifier),
FOREIGN KEY(serial_number, authority_key_identifier) REFERENCES certificates(serial_number, authority_key_identifier)
);
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE ocsp_responses;
DROP TABLE certificates;
|