diff --git a/migrations/20210820172800-users-alter-loginLocationsJson.js b/migrations/20210820172800-users-alter-loginLocationsJson.js new file mode 100644 index 000000000..7e139a4a0 --- /dev/null +++ b/migrations/20210820172800-users-alter-loginLocationsJson.js @@ -0,0 +1,15 @@ +'use strict'; + +exports.up = function(db, callback) { + db.runSql('ALTER TABLE users MODIFY loginLocationsJson MEDIUMTEXT', [], function (error) { + if (error) console.error(error); + callback(error); + }); +}; + +exports.down = function(db, callback) { + db.runSql('ALTER TABLE users MODIFY loginLocationsJson TEXT', [], function (error) { + if (error) console.error(error); + callback(error); + }); +}; diff --git a/migrations/schema.sql b/migrations/schema.sql index 2c86abfc7..fdfe10f98 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -32,7 +32,7 @@ CREATE TABLE IF NOT EXISTS users( resetTokenCreationTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, active BOOLEAN DEFAULT 1, avatar MEDIUMBLOB NOT NULL, - locationJson TEXT, // { locations: [{ ip, userAgent, city, country, ts }] } + loginLocationsJson MEDIUMTEXT, // { locations: [{ ip, userAgent, city, country, ts }] } INDEX creationTime_index (creationTime), PRIMARY KEY(id));