diff --git a/services/web/app/src/infrastructure/mongodb.js b/services/web/app/src/infrastructure/mongodb.js index f14d5595f4..ada77c4380 100644 --- a/services/web/app/src/infrastructure/mongodb.js +++ b/services/web/app/src/infrastructure/mongodb.js @@ -61,6 +61,7 @@ async function setupDb() { db.githubSyncUserCredentials = internalDb.collection( 'githubSyncUserCredentials' ) + db.grouppolicies = internalDb.collection('grouppolicies') db.institutions = internalDb.collection('institutions') db.messages = internalDb.collection('messages') db.migrations = internalDb.collection('migrations') diff --git a/services/web/migrations/20240625101055_add_ai_policy_to_group_policy.js b/services/web/migrations/20240625101055_add_ai_policy_to_group_policy.js new file mode 100644 index 0000000000..a9027cfd20 --- /dev/null +++ b/services/web/migrations/20240625101055_add_ai_policy_to_group_policy.js @@ -0,0 +1,17 @@ +exports.tags = ['saas'] + +exports.migrate = async client => { + const { db } = client + await db.grouppolicies.updateMany( + {}, + { $set: { userCannotUseAIFeatures: true } } + ) +} + +exports.rollback = async client => { + const { db } = client + await db.grouppolicies.updateMany( + {}, + { $unset: { userCannotUseAIFeatures: '' } } + ) +}