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); +```