mirror of
https://github.com/outline/outline.git
synced 2026-12-06 11:12:32 +03:00
* Treat legacy boolean commenting preference as disabled Teams not yet migrated to the CommentingAccess enum may still have a boolean `false` stored for the commenting preference. Guard the enabled checks so `false` reads as disabled rather than enabled. * Move commenting setting from Details to Security settings --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
module.exports = {
|
|
async up(queryInterface) {
|
|
// Convert the legacy boolean "commenting" team preference into the
|
|
// CommentingAccess enum: false -> "none", true -> "members".
|
|
await queryInterface.sequelize.query(`
|
|
UPDATE teams
|
|
SET preferences = jsonb_set(preferences, '{commenting}', '"none"')
|
|
WHERE preferences -> 'commenting' = 'false'::jsonb
|
|
`);
|
|
await queryInterface.sequelize.query(`
|
|
UPDATE teams
|
|
SET preferences = jsonb_set(preferences, '{commenting}', '"members"')
|
|
WHERE preferences -> 'commenting' = 'true'::jsonb
|
|
`);
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.sequelize.query(`
|
|
UPDATE teams
|
|
SET preferences = jsonb_set(preferences, '{commenting}', 'false')
|
|
WHERE preferences -> 'commenting' = '"none"'::jsonb
|
|
`);
|
|
await queryInterface.sequelize.query(`
|
|
UPDATE teams
|
|
SET preferences = jsonb_set(preferences, '{commenting}', 'true')
|
|
WHERE preferences -> 'commenting' IN ('"members"'::jsonb, '"everyone"'::jsonb)
|
|
`);
|
|
},
|
|
};
|