Rename struct fields

This commit is contained in:
Till Faelligen 2020-10-01 22:21:27 +02:00
parent 71592fde6a
commit e6cf3f0df7
3 changed files with 8 additions and 8 deletions

View file

@ -213,8 +213,8 @@ type Device struct {
// associated with access tokens. // associated with access tokens.
SessionID int64 SessionID int64
DisplayName string DisplayName string
LastSeen int64 LastSeenTS int64
IPAddr string LastSeenIP string
} }
// Account represents a Matrix account on this home server. // Account represents a Matrix account on this home server.

View file

@ -65,7 +65,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS device_localpart_id_idx ON device_devices(loca
` `
const insertDeviceSQL = "" + const insertDeviceSQL = "" +
"INSERT INTO device_devices(device_id, localpart, access_token, created_ts, display_name, last_used_ts, ip) VALUES ($1, $2, $3, $4, $5, $6, $7)" + "INSERT INTO device_devices(device_id, localpart, access_token, created_ts, display_name, last_seen_ts, ip) VALUES ($1, $2, $3, $4, $5, $6, $7)" +
" RETURNING session_id" " RETURNING session_id"
const selectDeviceByTokenSQL = "" + const selectDeviceByTokenSQL = "" +
@ -166,8 +166,8 @@ func (s *devicesStatements) insertDevice(
UserID: userutil.MakeUserID(localpart, s.serverName), UserID: userutil.MakeUserID(localpart, s.serverName),
AccessToken: accessToken, AccessToken: accessToken,
SessionID: sessionID, SessionID: sessionID,
LastSeen: createdTimeMS, LastSeenTS: createdTimeMS,
IPAddr: ipAddr, LastSeenIP: ipAddr,
}, nil }, nil
} }

View file

@ -48,7 +48,7 @@ CREATE TABLE IF NOT EXISTS device_devices (
` `
const insertDeviceSQL = "" + const insertDeviceSQL = "" +
"INSERT INTO device_devices (device_id, localpart, access_token, created_ts, display_name, session_id, last_used_ts, ip)" + "INSERT INTO device_devices (device_id, localpart, access_token, created_ts, display_name, session_id, last_seen_ts, ip)" +
" VALUES ($1, $2, $3, $4, $5, $6, $7, $8)" " VALUES ($1, $2, $3, $4, $5, $6, $7, $8)"
const selectDevicesCountSQL = "" + const selectDevicesCountSQL = "" +
@ -161,8 +161,8 @@ func (s *devicesStatements) insertDevice(
UserID: userutil.MakeUserID(localpart, s.serverName), UserID: userutil.MakeUserID(localpart, s.serverName),
AccessToken: accessToken, AccessToken: accessToken,
SessionID: sessionID, SessionID: sessionID,
LastSeen: createdTimeMS, LastSeenTS: createdTimeMS,
IPAddr: ipAddr, LastSeenIP: ipAddr,
}, nil }, nil
} }