diff --git a/packages/server/postgres/migrations/1720689742934_fixThreatLevelPromptColors.ts b/packages/server/postgres/migrations/1720689742934_fixThreatLevelPromptColors.ts new file mode 100644 index 00000000000..72cd4145d7c --- /dev/null +++ b/packages/server/postgres/migrations/1720689742934_fixThreatLevelPromptColors.ts @@ -0,0 +1,42 @@ +import {r} from 'rethinkdb-ts' +import connectRethinkDB from '../../database/connectRethinkDB' + +export async function up() { + await connectRethinkDB() + + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateSeverePrompt') + .update({groupColor: '#FD6157'}) + .run() + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateElevatedPrompt') + .update({groupColor: '#FFCC63'}) + .run() + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateLowPrompt') + .update({groupColor: '#66BC8C'}) + .run() +} + +export async function down() { + await connectRethinkDB() + + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateSeverePrompt') + .update({groupColor: '#66BC8C'}) + .run() + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateElevatedPrompt') + .update({groupColor: '#FD6157'}) + .run() + await r + .table('ReflectPrompt') + .get('threatLevelPremortemTemplateLowPrompt') + .update({groupColor: '#FFCC63'}) + .run() +}