diff options
-rw-r--r-- | db/seed.sql | 15 | ||||
-rw-r--r-- | server/store/store_test.go | 17 |
2 files changed, 0 insertions, 32 deletions
diff --git a/db/seed.sql b/db/seed.sql deleted file mode 100644 index 03f7b1e..0000000 --- a/db/seed.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `certs`; - -USE `certs`; - -CREATE TABLE `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`); diff --git a/server/store/store_test.go b/server/store/store_test.go index d18d02b..5704ce0 100644 --- a/server/store/store_test.go +++ b/server/store/store_test.go @@ -3,12 +3,10 @@ package store import ( "crypto/rand" "crypto/rsa" - "database/sql" "encoding/json" "io/ioutil" "os" "os/user" - "strings" "testing" "time" @@ -135,21 +133,6 @@ func TestSQLiteStore(t *testing.T) { t.Error(err) } defer os.Remove(f.Name()) - - seed, err := ioutil.ReadFile("../../db/seed.sql") - if err != nil { - t.Error(err) - } - stmts := strings.Split(string(seed), ";") - d, _ := sql.Open("sqlite3", f.Name()) - for _, stmt := range stmts { - if !strings.Contains(stmt, "CREATE TABLE") { - continue - } - d.Exec(stmt) - } - d.Close() - config := map[string]string{"type": "sqlite", "filename": f.Name()} db, err := NewSQLStore(config) if err != nil { |