diff --git a/migrations/20230409141801_initial.sql b/migrations/20230409141801_initial.sql index 4c3e77d..a018dc4 100644 --- a/migrations/20230409141801_initial.sql +++ b/migrations/20230409141801_initial.sql @@ -5,6 +5,7 @@ CREATE TABLE key_db ( creation INTEGER, not_after INTEGER, revocation INTEGER, + published BOOLEAN, private_key TEXT, public_key TEXT ); diff --git a/src/key.rs b/src/key.rs index ab3ec1f..651f1a3 100644 --- a/src/key.rs +++ b/src/key.rs @@ -12,6 +12,7 @@ const INSERT_KEY: &str = "INSERT INTO key_db ( creation, not_after, revocation, + published, private_key, public_key ) VALUES ( @@ -21,6 +22,7 @@ const INSERT_KEY: &str = "INSERT INTO key_db ( $4, $5, $6, + FALSE, $7, $8 )"; @@ -29,6 +31,7 @@ FROM key_db WHERE sdid = $1 AND algorithm = $2 + AND published IS FALSE ORDER BY not_after DESC LIMIT 1";