Created dev env and implement db lookup for prefixes

This commit is contained in:
Dustin Pianalto
2020-08-28 01:12:41 -08:00
parent dd0f9cba57
commit 2f6d45d4ef
3 changed files with 55 additions and 4 deletions
+4 -2
View File
@@ -3,6 +3,7 @@ package utils
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
@@ -84,7 +85,8 @@ func InitializeDatabase() {
"user_id varchar(30) not null," +
"creation_time timestamp not null default NOW()," +
"trigger_time timestamp not null," +
"completed bool not null default false)")
"completed bool not null default false," +
"processing bool default false)")
if err != nil {
fmt.Println(err)
}
@@ -103,7 +105,7 @@ func LoadTestData() {
if err != nil {
fmt.Println(err)
}
_, err = Database.Query("INSERT INTO prefixes (prefix) VALUES ('Go.'), ('go.'), ('go,')")
_, err = Database.Query("INSERT INTO prefixes (prefix) VALUES ('Godev.'), ('godev.'), ('godev,')")
if err != nil {
fmt.Println(err)
}