diff --git a/database/postgres/statements.go b/database/postgres/statements.go index a7cf8b6b..c0e09c39 100644 --- a/database/postgres/statements.go +++ b/database/postgres/statements.go @@ -63,8 +63,8 @@ var statements = map[string]string{ queryGetUserByEmail: fmt.Sprintf("SELECT %s FROM %s WHERE email = $1", userSelectColumnsFull, tableUsers), queryGetUserByName: fmt.Sprintf("SELECT %s FROM %s WHERE username = $1", userSelectColumnsFull, tableUsers), queryGetUserByID: fmt.Sprintf("SELECT %s FROM %s WHERE user_id = $1", userSelectColumnsFull, tableUsers), - queryInsertUser: fmt.Sprintf("INSERT INTO %s (username, password, email, status, created_at, updated_at, last_login_at, last_login_ip, api_token, api_token_expires, language, md5 ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)", tableUsers), - queryUpdateUser: fmt.Sprintf("UPDATE %s SET (username = $2, password = $3 , email = $4, status = $5, updated_at = $6, last_login_at = $7 , last_login_ip = $8 , api_token = $9 , api_token_expiry = $10 , language = $11 , md5 = $12 ) WHERE user_id = $1", tableUsers), + queryInsertUser: fmt.Sprintf("INSERT INTO %s (username, password, email, status, created_at, updated_at, last_login_at, api_token, api_token_expires, language, md5 ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)", tableUsers), + queryUpdateUser: fmt.Sprintf("UPDATE %s SET (username = $2, password = $3 , email = $4, status = $5, updated_at = $6, last_login_at = $7 , lapi_token = $8 , api_token_expiry = $9 , language = $10 , md5 = $11 ) WHERE user_id = $1", tableUsers), queryDeleteUserByID: fmt.Sprintf("DELETE FROM %s WHERE user_id = $1", tableUsers), queryDeleteUserByEmail: fmt.Sprintf("DELETE FROM %s WHERE email = $1", tableUsers), queryDeleteUserByToken: fmt.Sprintf("DELETE FROM %s WHERE api_token = $1", tableUsers), diff --git a/database/postgres/tables.go b/database/postgres/tables.go index 1159bd42..9cc9aa11 100644 --- a/database/postgres/tables.go +++ b/database/postgres/tables.go @@ -37,7 +37,6 @@ var tables = []createTable{ "created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL", "updated_at TIMESTAMP WITHOUT TIME ZONE", "last_login_at TIMESTAMP WITHOUT TIME ZONE", - "last_login_ip TEXT", "api_token TEXT", "api_token_expiry TIMESTAMP WITHOUT TIME ZONE NOT NULL", "language TEXT",