Compare commits

...
2 Commits
Author SHA1 Message Date
Dustin Pianalto 7a8e7bf213 use nullable string in user
CI / build (push) Has been cancelled
2021-01-23 16:05:02 -09:00
Dustin Pianalto 96e8388562 fix bug in user database
CI / build (push) Has been cancelled
2021-01-23 15:10:04 -09:00
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ func ConnectDatabase(dbConnString string) {
func(name string) ([]byte, error) {
return migrations.Asset(name)
})
db, err := sql.Open("postgres", dbConnString)
var err error
db, err = sql.Open("postgres", dbConnString)
if err != nil {
log.Fatal(fmt.Errorf("Can't connect to the database: %w", err))
}
-1
View File
@@ -263,7 +263,6 @@ func addUserCommandFunc(ctx disgoman.Context, args []string) {
if ctx.Message.Author.ID == ctx.CommandManager.Owners[0] {
user := geeksbot.User{
ID: ctx.Message.Author.ID,
SteamID: "",
IsActive: true,
IsStaff: true,
IsAdmin: true,
+3 -1
View File
@@ -1,8 +1,10 @@
package geeksbot
import "database/sql"
type User struct {
ID string
SteamID string
SteamID sql.NullString
IsActive bool
IsStaff bool
IsAdmin bool