Compare commits

..
5 Commits
Author SHA1 Message Date
Dustin Pianalto ab2d51c582 fix bug in user service
CI / build (push) Has been cancelled
2021-01-23 14:59:35 -09:00
Dustin Pianalto 5400d6acd9 fix bug in user service
CI / build (push) Has been cancelled
2021-01-23 14:48:59 -09:00
Dustin Pianalto 74edd574b3 fix bug in user service
CI / build (push) Has been cancelled
2021-01-23 14:46:25 -09:00
Dustin Pianalto 266cde6468 fix bug in running migrations
CI / build (push) Has been cancelled
2021-01-23 04:27:34 -09:00
Dustin Pianalto 8b646731ee change test command name
CI / build (push) Has been cancelled
2021-01-23 04:20:17 -09:00
4 changed files with 9 additions and 6 deletions
+5 -1
View File
@@ -49,7 +49,11 @@ func ConnectDatabase(dbConnString string) {
} }
err = m.Up() err = m.Up()
if err != nil { if err != nil {
log.Fatal(err) if err.Error() == "no change" {
log.Println(err)
} else {
log.Fatal(err)
}
} }
log.Println("Migrations Run") log.Println("Migrations Run")
initServices() initServices()
+2 -1
View File
@@ -20,7 +20,8 @@ func (s userService) User(id string) (geeksbot.User, error) {
func (s userService) CreateUser(u geeksbot.User) (geeksbot.User, error) { func (s userService) CreateUser(u geeksbot.User) (geeksbot.User, error) {
queryString := "INSERT INTO users (id, steam_id, active, staff, admin) VALUES ($1, $2, $3, $4, $5)" queryString := "INSERT INTO users (id, steam_id, active, staff, admin) VALUES ($1, $2, $3, $4, $5)"
_, err := s.db.Exec(queryString, u.ID, u.SteamID, u.IsActive, u.IsStaff, u.IsAdmin) var err error
_, err = s.db.Exec(queryString, u.ID, u.SteamID, u.IsActive, u.IsStaff, u.IsAdmin)
return u, err return u, err
} }
+1 -1
View File
@@ -250,7 +250,7 @@ func userCommandFunc(ctx disgoman.Context, args []string) {
} }
var AddUserCommand = &disgoman.Command{ var AddUserCommand = &disgoman.Command{
Name: "user", Name: "adduser",
Aliases: nil, Aliases: nil,
Description: "Get user info", Description: "Get user info",
OwnerOnly: false, OwnerOnly: false,
+1 -3
View File
@@ -1,10 +1,8 @@
package geeksbot package geeksbot
import "database/sql"
type User struct { type User struct {
ID string ID string
SteamID sql.NullString SteamID string
IsActive bool IsActive bool
IsStaff bool IsStaff bool
IsAdmin bool IsAdmin bool