aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/seed.js3
-rw-r--r--db/seed.sql13
2 files changed, 16 insertions, 0 deletions
diff --git a/db/seed.js b/db/seed.js
new file mode 100644
index 0000000..c9d62fa
--- /dev/null
+++ b/db/seed.js
@@ -0,0 +1,3 @@
+conn = new Mongo();
+db = conn.getDB("certs");
+db.issued_certs.createIndex({"keyid": 1}, {unique: true});
diff --git a/db/seed.sql b/db/seed.sql
new file mode 100644
index 0000000..cf5e62a
--- /dev/null
+++ b/db/seed.sql
@@ -0,0 +1,13 @@
+CREATE DATABASE IF NOT EXISTS `certs`;
+
+USE `certs`;
+
+CREATE TABLE `issued_certs` (
+ `key_id` varchar(255) NOT NULL,
+ `principals` varchar(255) DEFAULT NULL,
+ `created_at` datetime DEFAULT NULL,
+ `expires_at` datetime DEFAULT NULL,
+ `revoked` tinyint(1) DEFAULT NULL,
+ `raw_key` text,
+ PRIMARY KEY (`key_id`)
+);