Skip to content

Commit

Permalink
Merge pull request #689 from kabalin/logins
Browse files Browse the repository at this point in the history
Convert login value to string for logins containing number types.
  • Loading branch information
kabalin authored Jul 26, 2024
2 parents 13111c7 + 79aaf83 commit 7639e55
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 798 deletions.
18 changes: 18 additions & 0 deletions migrations/20240721234722-login_to_string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright: The PastVu contributors.
* GNU Affero General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/agpl.txt)
*/

/**
* Update numeric login to string. We have some old numeric logins, they fail on profile
* viewing.
*/
module.exports = {
async up(db) {
await db.collection('users').updateMany({ login: { $type: 1 } }, [{ $set: { login: { $toString: '$login' } } }]);
},

async down() {
// No rollback.
},
};
Loading

0 comments on commit 7639e55

Please sign in to comment.