diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-23 22:29:46 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-23 22:29:46 +0100 |
commit | eb1184b284ea37cc31556e3598916ac9c3fa6939 (patch) | |
tree | 20131b8be8e77ad1e575f8d616bf2294d3cfb888 /server/store/migrations | |
parent | 99225736d41e86c7f47eac4db3455b18178bba24 (diff) |
Record request reason in the db instead of logging
Diffstat (limited to 'server/store/migrations')
-rw-r--r-- | server/store/migrations/mysql/20180822204521_add_reason.sql | 5 | ||||
-rw-r--r-- | server/store/migrations/sqlite3/20180822204521_add_reason.sql | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/server/store/migrations/mysql/20180822204521_add_reason.sql b/server/store/migrations/mysql/20180822204521_add_reason.sql new file mode 100644 index 0000000..85fdd4d --- /dev/null +++ b/server/store/migrations/mysql/20180822204521_add_reason.sql @@ -0,0 +1,5 @@ +-- +migrate Up +ALTER TABLE `issued_certs` ADD COLUMN `message` TEXT NOT NULL; + +-- +migrate Down +ALTER TABLE `issued_certs` DROP COLUMN `message`;
\ No newline at end of file diff --git a/server/store/migrations/sqlite3/20180822204521_add_reason.sql b/server/store/migrations/sqlite3/20180822204521_add_reason.sql new file mode 100644 index 0000000..07e9d49 --- /dev/null +++ b/server/store/migrations/sqlite3/20180822204521_add_reason.sql @@ -0,0 +1,18 @@ +-- +migrate Up +ALTER TABLE `issued_certs` ADD COLUMN `message` TEXT NOT NULL DEFAULT ""; + +-- +migrate Down +CREATE TABLE `issued_certs_new` ( + `id` INTEGER PRIMARY KEY, + `key_id` varchar(255) UNIQUE NOT NULL, + `principals` varchar(255) DEFAULT '[]', + `created_at` datetime DEFAULT '1970-01-01 00:00:01', + `expires_at` datetime DEFAULT '1970-01-01 00:00:01', + `revoked` tinyint(1) DEFAULT '0', + `raw_key` text +); +INSERT INTO `issued_certs_new` (key_id, principals, created_at, expires_at, revoked, raw_key) + SELECT key_id, principals, created_at, expires_at, revoked, raw_key FROM `issued_certs`; +DROP TABLE `issued_certs`; +ALTER TABLE `issued_certs_new` RENAME TO `issued_certs`; +CREATE INDEX `idx_expires_at` ON `issued_certs` (`expires_at`);
\ No newline at end of file |