mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
d2172e5179
* [web] Issue Oauth2 access tokens * [web] Add partial index for `oauthAccessTokens.user_id` for Personal Access Tokens * [web] script to create personal access tokens GitOrigin-RevId: 796e8d23a6799a87ac6096c686139c6290668b83
21 lines
491 B
JavaScript
21 lines
491 B
JavaScript
const Helpers = require('./lib/helpers')
|
|
|
|
exports.tags = ['server-ce', 'server-pro', 'saas']
|
|
|
|
const indexes = [
|
|
{
|
|
key: { user_id: 1 },
|
|
name: 'pat_user_id_1',
|
|
partialFilterExpression: { type: 'pat' },
|
|
},
|
|
]
|
|
|
|
exports.migrate = async client => {
|
|
const { db } = client
|
|
await Helpers.addIndexesToCollection(db.oauthAccessTokens, indexes)
|
|
}
|
|
|
|
exports.rollback = async client => {
|
|
const { db } = client
|
|
await Helpers.dropIndexesFromCollection(db.oauthAccessTokens, indexes)
|
|
}
|