From 191ed410e491d2f1da1dcb76b512bc335ff6fb1d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 9 May 2019 00:48:57 -0600 Subject: [PATCH] document table --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index d52245d..c7fb4ac 100644 --- a/README.md +++ b/README.md @@ -141,3 +141,43 @@ Greenlock.create({ ... }); ``` + +## Table Structure + +This is the table structure that's created. + +```sql +CREATE TABLE `Keypairs` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `xid` VARCHAR(255) UNIQUE, + `content` TEXT, + `createdAt` DATETIME NOT NULL, + `updatedAt` DATETIME NOT NULL); + +CREATE TABLE `Domains` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `subject` VARCHAR(255) UNIQUE, + `altnames` TEXT, + `createdAt` DATETIME NOT NULL, + `updatedAt` DATETIME NOT NULL); + +CREATE TABLE `Certificates` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `subject` VARCHAR(255) UNIQUE, + `cert` TEXT, + `issuedAt` DATETIME, + `expiresAt` DATETIME, + `altnames` TEXT, + `chain` TEXT, + `createdAt` DATETIME NOT NULL, + `updatedAt` DATETIME NOT NULL); + +CREATE TABLE `Chains` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `xid` VARCHAR(255) UNIQUE, + `content` TEXT, + `createdAt` DATETIME NOT NULL, + `updatedAt` DATETIME NOT NULL, + `CertificateId` INTEGER REFERENCES + `Certificates` (`id`) ON DELETE SET NULL ON UPDATE CASCADE); +```