Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure tls_certificates table exists in migrator #689

Merged
merged 2 commits into from
Aug 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/manage_migrators.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,24 @@ migrate_212_to_213 ()

/* Update the database. */

/* Ensure the table tls_certificates exists */
sql ("CREATE TABLE IF NOT EXISTS tls_certificates"
" (id SERIAL PRIMARY KEY,"
" uuid text UNIQUE NOT NULL,"
" owner integer REFERENCES users (id) ON DELETE RESTRICT,"
" name text,"
" comment text,"
" creation_time integer,"
" modification_time integer,"
" certificate text,"
" subject_dn text,"
" issuer_dn text,"
" activation_time integer,"
" expiration_time integer,"
" md5_fingerprint text,"
" trust integer,"
" certificate_format text);");

/* Add columns to tls_certificates */
sql ("ALTER TABLE tls_certificates"
" ADD COLUMN sha256_fingerprint text;");
Expand Down