From 2ce3b86e0ff69538935db3149d1ed2f24aea09a3 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Mon, 13 Apr 2020 23:57:13 -0400 Subject: Simplify --- .../mysql/20180626224600_create_issued_certs.sql | 15 --------------- .../mysql/20180807223808_idx_revoked_expires_at.sql | 5 ----- .../migrations/mysql/20180807224200_new_primary_key.sql | 11 ----------- .../store/migrations/mysql/20180822204521_add_reason.sql | 5 ----- 4 files changed, 36 deletions(-) delete mode 100644 server/store/migrations/mysql/20180626224600_create_issued_certs.sql delete mode 100644 server/store/migrations/mysql/20180807223808_idx_revoked_expires_at.sql delete mode 100644 server/store/migrations/mysql/20180807224200_new_primary_key.sql delete mode 100644 server/store/migrations/mysql/20180822204521_add_reason.sql (limited to 'server/store/migrations/mysql') diff --git a/server/store/migrations/mysql/20180626224600_create_issued_certs.sql b/server/store/migrations/mysql/20180626224600_create_issued_certs.sql deleted file mode 100644 index c5b80e0..0000000 --- a/server/store/migrations/mysql/20180626224600_create_issued_certs.sql +++ /dev/null @@ -1,15 +0,0 @@ --- +migrate Up -CREATE TABLE IF NOT EXISTS `issued_certs` ( - `key_id` varchar(255) 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, - PRIMARY KEY (`key_id`) -); -CREATE INDEX `idx_expires_at` ON `issued_certs` (`expires_at`); -CREATE INDEX `idx_revoked_expires_at` ON `issued_certs` (`revoked`, `expires_at`); - --- +migrate Down -DROP TABLE `issued_certs`; diff --git a/server/store/migrations/mysql/20180807223808_idx_revoked_expires_at.sql b/server/store/migrations/mysql/20180807223808_idx_revoked_expires_at.sql deleted file mode 100644 index fe82dd5..0000000 --- a/server/store/migrations/mysql/20180807223808_idx_revoked_expires_at.sql +++ /dev/null @@ -1,5 +0,0 @@ --- +migrate Up -ALTER TABLE `issued_certs` DROP INDEX `idx_revoked_expires_at`; - --- +migrate Down -ALTER TABLE `issued_certs` ADD INDEX `idx_revoked_expires_at` (`revoked`,`expires_at`); diff --git a/server/store/migrations/mysql/20180807224200_new_primary_key.sql b/server/store/migrations/mysql/20180807224200_new_primary_key.sql deleted file mode 100644 index ed6a3c2..0000000 --- a/server/store/migrations/mysql/20180807224200_new_primary_key.sql +++ /dev/null @@ -1,11 +0,0 @@ --- +migrate Up -ALTER TABLE `issued_certs` - DROP PRIMARY KEY, - ADD COLUMN `id` INT PRIMARY KEY AUTO_INCREMENT FIRST, - ADD UNIQUE INDEX `idx_key_id` (`key_id`); - --- +migrate Down -ALTER TABLE `issued_certs` - DROP PRIMARY KEY, - DROP COLUMN `id`, - ADD PRIMARY KEY (`key_id`); diff --git a/server/store/migrations/mysql/20180822204521_add_reason.sql b/server/store/migrations/mysql/20180822204521_add_reason.sql deleted file mode 100644 index 85fdd4d..0000000 --- a/server/store/migrations/mysql/20180822204521_add_reason.sql +++ /dev/null @@ -1,5 +0,0 @@ --- +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 -- cgit v1.2.3