feat: rename comment thread into activity (#939)

* feat: rename commentThread into activity server

* feat: rename commentThread into activity front

* feat: migration only create tables


feat: migration only create tables

* Update activities

* fix: rebase partial fix

* fix: all rebase problems and drop activity target alter

* fix: lint

* Update migration

* Update migration

* Fix conflicts

* Fix conflicts

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jérémy M
2023-07-28 08:22:16 +02:00
committed by GitHub
parent fcdde024a3
commit d0641084f9
95 changed files with 2112 additions and 1725 deletions

View File

@ -1,6 +1,6 @@
import { PrismaClient } from '@prisma/client';
export const seedComments = async (prisma: PrismaClient) => {
await prisma.commentThread.upsert({
await prisma.activity.upsert({
where: { id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400' },
update: {},
create: {
@ -13,15 +13,15 @@ export const seedComments = async (prisma: PrismaClient) => {
},
});
await prisma.commentThreadTarget.upsert({
await prisma.activityTarget.upsert({
where: { id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb600' },
update: {},
create: {
id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb600',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
commentableType: 'Company',
commentableId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfa408',
commentThreadId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
activityId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
},
});
@ -32,6 +32,7 @@ export const seedComments = async (prisma: PrismaClient) => {
id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb200',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
body: 'Hi Félix ! How do you like your Twenty workspace?',
activityId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
commentThreadId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408',
},
@ -44,12 +45,13 @@ export const seedComments = async (prisma: PrismaClient) => {
id: 'twenty-fe256b40-3ec3-4fe3-8997-b76aa0bfb200',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
body: 'I love it!',
activityId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
commentThreadId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
authorId: 'twenty-gk256b39-3ec3-4fe3-8997-b76aa0bfa408',
},
});
await prisma.commentThread.upsert({
await prisma.activity.upsert({
where: { id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408' },
update: {},
create: {
@ -64,15 +66,15 @@ export const seedComments = async (prisma: PrismaClient) => {
},
});
await prisma.commentThreadTarget.upsert({
await prisma.activityTarget.upsert({
where: { id: 'twenty-fe256b39-3ec3-4fe3-8997-a76aa0bfb600' },
update: {},
create: {
id: 'twenty-fe256b39-3ec3-4fe3-8997-a76aa0bfb600',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
commentableType: 'Person',
commentableId: 'twenty-755035db-623d-41fe-92e7-dd45b7c568e1',
commentThreadId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408',
activityId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
},
});
@ -83,12 +85,13 @@ export const seedComments = async (prisma: PrismaClient) => {
id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb100',
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
body: 'I really like this comment thread feature!',
activityId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408',
commentThreadId: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408',
authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408',
},
});
await prisma.commentThread.upsert({
await prisma.activity.upsert({
where: { id: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408' },
update: {},
create: {
@ -100,15 +103,15 @@ export const seedComments = async (prisma: PrismaClient) => {
},
});
await prisma.commentThreadTarget.upsert({
await prisma.activityTarget.upsert({
where: { id: 'twenty-dev-fe256b39-3ec3-4fe3-8997-a76aa0bfba00' },
update: {},
create: {
id: 'twenty-dev-fe256b39-3ec3-4fe3-8997-a76aa0bfba00',
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
commentableType: 'Company',
commentableId: 'twenty-dev-a674fa6c-1455-4c57-afaf-dd5dc086361e',
commentThreadId: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408',
activityId: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408',
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
},
});
@ -119,6 +122,7 @@ export const seedComments = async (prisma: PrismaClient) => {
id: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aa0bfb000',
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
body: 'I really like this comment thread feature!',
activityId: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408',
commentThreadId: 'twenty-dev-fe256b39-3ec3-4fe3-8997-b76aaabfb408',
authorId: 'twenty-dev-gk256b39-3ec3-4fe3-8997-b76aa0boa408',
},