Skip to content

Commit

Permalink
enable SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvtol committed Apr 16, 2021
1 parent f93933e commit a9de66c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func SetupModels() *gorm.DB {
viper_port := viper.Get("POSTGRES_PORT")

// https://gobyexample.com/string-formatting
prosgret_conname := fmt.Sprintf("host=%v port=%v user=%v dbname=%v password=%v sslmode=disable", viper_host, viper_port, viper_user, viper_db, viper_password)
prosgret_conname := fmt.Sprintf("host=%v port=%v user=%v dbname=%v password=%v sslmode=require", viper_host, viper_port, viper_user, viper_db, viper_password)

fmt.Println("conname is\t\t", prosgret_conname)

db, err := gorm.Open("postgres", prosgret_conname)
if err != nil {
panic("Failed to connect to database!")
panic(err)
}

db.AutoMigrate(&Team{})
Expand Down

0 comments on commit a9de66c

Please sign in to comment.