Remove old body on note and tasks (#13290)

Fixes: https://github.com/twentyhq/twenty/issues/13110

I'm deprecating note.body and task.body to remove confusion between body
and bodyV2

What will be left but should be done later to avoid breaking changes:
- re-add a body field in the graphql API only that points to the same
bodyV2 field in SQL (need to be handled in fields and filter for note
and task)
- (wait some time)
- remove bodyV2 field
This commit is contained in:
Charles Bochet
2025-07-19 11:25:49 +02:00
committed by GitHub
parent 62202af1a9
commit fdc6705a75
23 changed files with 124 additions and 128 deletions
@@ -4,9 +4,8 @@ type NoteDataSeed = {
id: string;
position: number;
title: string;
body: string | null;
bodyV2Blocknote: string | null;
bodyV2Markdown: string | null;
bodyV2Blocknote: string
bodyV2Markdown: string;
createdBySource: string;
createdByWorkspaceMemberId: string;
createdByName: string;
@@ -17,7 +16,6 @@ export const NOTE_DATA_SEED_COLUMNS: (keyof NoteDataSeed)[] = [
'id',
'position',
'title',
'body',
'bodyV2Blocknote',
'bodyV2Markdown',
'createdBySource',
@@ -145,7 +143,6 @@ const GENERATE_NOTE_SEEDS = (): NoteDataSeed[] => {
id: NOTE_DATA_SEED_IDS[`ID_${INDEX}`],
position: INDEX,
title: TEMPLATE.title,
body: null,
bodyV2Blocknote: JSON.stringify([
{
id: `block-${INDEX}`,
@@ -176,7 +173,6 @@ const GENERATE_NOTE_SEEDS = (): NoteDataSeed[] => {
id: NOTE_DATA_SEED_IDS[`ID_${INDEX}`],
position: INDEX,
title: TEMPLATE.title,
body: null,
bodyV2Blocknote: JSON.stringify([
{
id: `block-${INDEX}`,
@@ -4,7 +4,8 @@ type TaskDataSeed = {
id: string;
position: number;
title: string;
body: string | null;
bodyV2Blocknote: string;
bodyV2Markdown: string;
status: string;
dueAt: string | null;
assigneeId: string;
@@ -17,7 +18,8 @@ export const TASK_DATA_SEED_COLUMNS: (keyof TaskDataSeed)[] = [
'id',
'position',
'title',
'body',
'bodyV2Blocknote',
'bodyV2Markdown',
'status',
'dueAt',
'assigneeId',
@@ -188,7 +190,20 @@ const GENERATE_TASK_SEEDS = (): TaskDataSeed[] => {
id: TASK_DATA_SEED_IDS[`ID_${INDEX}`],
position: INDEX,
title: TEMPLATE.title,
body: TEMPLATE.body,
bodyV2Blocknote: JSON.stringify([
{
id: `block-${INDEX}`,
type: 'paragraph',
props: {
textColor: 'default',
backgroundColor: 'default',
textAlignment: 'left',
},
content: [{ type: 'text', text: TEMPLATE.body, styles: {} }],
children: [],
},
]),
bodyV2Markdown: TEMPLATE.body,
status: TEMPLATE.status,
dueAt: FORMAT_DUE_DATE(TEMPLATE.daysFromNow),
assigneeId: GET_RANDOM_ASSIGNEE(),
@@ -207,7 +222,20 @@ const GENERATE_TASK_SEEDS = (): TaskDataSeed[] => {
id: TASK_DATA_SEED_IDS[`ID_${INDEX}`],
position: INDEX,
title: TEMPLATE.title,
body: TEMPLATE.body,
bodyV2Blocknote: JSON.stringify([
{
id: `block-${INDEX}`,
type: 'paragraph',
props: {
textColor: 'default',
backgroundColor: 'default',
textAlignment: 'left',
},
content: [{ type: 'text', text: TEMPLATE.body, styles: {} }],
children: [],
},
]),
bodyV2Markdown: TEMPLATE.body,
status: TEMPLATE.status,
dueAt: FORMAT_DUE_DATE(TEMPLATE.daysFromNow),
assigneeId: GET_RANDOM_ASSIGNEE(),