Change column name, drop a useless one

This commit is contained in:
Bryan Ashby 2019-01-13 18:19:00 -07:00
parent 90137819dd
commit 403ee891d5
3 changed files with 7 additions and 8 deletions

View File

@ -70,7 +70,7 @@
points: 5
}
25: {
title: "Inquisitive Caller"
title: "Inquisitive"
globalText: "{userName} has logged into {boardName} {achievedValue} times!"
text: "You've logged into {boardName} {achievedValue} times!"
points: 10

View File

@ -180,7 +180,7 @@ class Achievements {
UserDb.get(
`SELECT COUNT() AS count
FROM user_achievement
WHERE user_id = ? AND achievement_tag = ? AND match_field = ?;`,
WHERE user_id = ? AND achievement_tag = ? AND match = ?;`,
[ user.userId, achievementTag, field],
(err, row) => {
return cb(err, row ? row.count : 0);
@ -193,9 +193,9 @@ class Achievements {
StatLog.incrementUserStat(info.client.user, UserProps.AchievementTotalPoints, info.details.points);
UserDb.run(
`INSERT INTO user_achievement (user_id, achievement_tag, timestamp, match_field, match_value)
VALUES (?, ?, ?, ?, ?);`,
[ info.client.user.userId, info.achievementTag, getISOTimestampString(info.timestamp), info.matchField, info.matchValue ],
`INSERT INTO user_achievement (user_id, achievement_tag, timestamp, match)
VALUES (?, ?, ?, ?);`,
[ info.client.user.userId, info.achievementTag, getISOTimestampString(info.timestamp), info.matchField ],
err => {
if(err) {
return cb(err);

View File

@ -194,9 +194,8 @@ const DB_INIT_TABLE = {
user_id INTEGER NOT NULL,
achievement_tag VARCHAR NOT NULL,
timestamp DATETIME NOT NULL,
match_field VARCHAR NOT NULL,
match_value VARCHAR NOT NULL,
UNIQUE(user_id, achievement_tag, match_field),
match VARCHAR NOT NULL,
UNIQUE(user_id, achievement_tag, match),
FOREIGN KEY(user_id) REFERENCES user(id) ON DELETE CASCADE
);`
);