Browse Source

Remotes database creation

cockroachdb doesn't like this when the account isn't a superuser
master v0.1.0
Noah Pederson 1 year ago
parent
commit
15cfc18ffb
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      pkg/contact/contact.go

+ 3
- 3
pkg/contact/contact.go View File

@ -21,9 +21,9 @@ type Service struct {
//Init initializes the service and creates any tables necessary in Service.DB to run the service
func (c *Service) Init() {
if _, err := c.DB.Exec("CREATE DATABASE IF NOT EXISTS packetlostandfound"); err != nil {
log.Fatal(err)
}
//if _, err := c.DB.Exec("CREATE DATABASE IF NOT EXISTS packetlostandfound"); err != nil {
// log.Fatal(err)
//}
if _, err := c.DB.Exec("CREATE TABLE IF NOT EXISTS CONTACT_SUBMISSIONS(ID SERIAL PRIMARY KEY, EMAIL TEXT NOT NULL, MESSAGE TEXT NOT NULL, SUBMITTED DATE NOT NULL DEFAULT CURRENT_DATE)"); err != nil {
log.Fatal(err)
}


Loading…
Cancel
Save