Deprecate and backfill delete ConnectedAccount twenty standard object (#20752)
# Introduction Following connected account permissions refactor and encryption Removing the old workspace schema twenty standard application connectedAccount objects and related standard fields and index - a lot of deadcode - instance command backfill cleaning the connected account object from workspaces
This commit is contained in:
-9
@@ -1,9 +1,7 @@
|
||||
import { CalendarChannelVisibility } from 'twenty-shared/types';
|
||||
import { CONNECTED_ACCOUNT_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant';
|
||||
|
||||
type CalendarChannelDataSeed = {
|
||||
id: string;
|
||||
connectedAccountId: string;
|
||||
handle: string;
|
||||
visibility: CalendarChannelVisibility;
|
||||
isContactAutoCreationEnabled: boolean;
|
||||
@@ -13,7 +11,6 @@ type CalendarChannelDataSeed = {
|
||||
export const CALENDAR_CHANNEL_DATA_SEED_COLUMNS: (keyof CalendarChannelDataSeed)[] =
|
||||
[
|
||||
'id',
|
||||
'connectedAccountId',
|
||||
'handle',
|
||||
'visibility',
|
||||
'isContactAutoCreationEnabled',
|
||||
@@ -38,7 +35,6 @@ export const CALENDAR_CHANNEL_DATA_SEED_IDS = GENERATE_CALENDAR_CHANNEL_IDS();
|
||||
export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.TIM,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM,
|
||||
handle: 'tim@apple.dev',
|
||||
visibility: CalendarChannelVisibility.METADATA,
|
||||
isContactAutoCreationEnabled: true,
|
||||
@@ -46,7 +42,6 @@ export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
},
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.JONY,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.JONY,
|
||||
handle: 'jony@apple.dev',
|
||||
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
|
||||
isContactAutoCreationEnabled: true,
|
||||
@@ -54,7 +49,6 @@ export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
},
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.PHIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.PHIL,
|
||||
handle: 'phil@apple.dev',
|
||||
visibility: CalendarChannelVisibility.METADATA,
|
||||
isContactAutoCreationEnabled: true,
|
||||
@@ -62,7 +56,6 @@ export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
},
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.JANE,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.JANE,
|
||||
handle: 'jane.austen@apple.dev',
|
||||
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
|
||||
isContactAutoCreationEnabled: true,
|
||||
@@ -70,7 +63,6 @@ export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
},
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.COMPANY_MAIN,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM,
|
||||
handle: 'company-main@apple.dev',
|
||||
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
|
||||
isContactAutoCreationEnabled: true,
|
||||
@@ -78,7 +70,6 @@ export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
|
||||
},
|
||||
{
|
||||
id: CALENDAR_CHANNEL_DATA_SEED_IDS.TEAM_CALENDAR,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM,
|
||||
handle: 'team-calendar@apple.dev',
|
||||
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
|
||||
isContactAutoCreationEnabled: true,
|
||||
|
||||
-9
@@ -3,7 +3,6 @@ import {
|
||||
MessageChannelType,
|
||||
MessageChannelVisibility,
|
||||
} from 'twenty-shared/types';
|
||||
import { CONNECTED_ACCOUNT_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant';
|
||||
|
||||
type MessageChannelDataSeed = {
|
||||
id: string;
|
||||
@@ -12,7 +11,6 @@ type MessageChannelDataSeed = {
|
||||
deletedAt: Date | null;
|
||||
isContactAutoCreationEnabled: boolean;
|
||||
type: MessageChannelType;
|
||||
connectedAccountId: string;
|
||||
handle: string;
|
||||
isSyncEnabled: boolean;
|
||||
visibility: MessageChannelVisibility;
|
||||
@@ -27,7 +25,6 @@ export const MESSAGE_CHANNEL_DATA_SEED_COLUMNS: (keyof MessageChannelDataSeed)[]
|
||||
'deletedAt',
|
||||
'isContactAutoCreationEnabled',
|
||||
'type',
|
||||
'connectedAccountId',
|
||||
'handle',
|
||||
'isSyncEnabled',
|
||||
'visibility',
|
||||
@@ -57,7 +54,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM,
|
||||
handle: 'tim@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
@@ -70,7 +66,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.JONY,
|
||||
handle: 'jony.ive@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
@@ -83,7 +78,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.PHIL,
|
||||
handle: 'phil.schiler@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
@@ -96,7 +90,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.JANE,
|
||||
handle: 'jane.austen@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
@@ -109,7 +102,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM, // Use TIM's connected account for shared inbox
|
||||
handle: 'support@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
@@ -122,7 +114,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
|
||||
deletedAt: null,
|
||||
isContactAutoCreationEnabled: true,
|
||||
type: MessageChannelType.EMAIL,
|
||||
connectedAccountId: CONNECTED_ACCOUNT_DATA_SEED_IDS.TIM, // Use TIM's connected account for shared inbox
|
||||
handle: 'sales@apple.dev',
|
||||
isSyncEnabled: false,
|
||||
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
|
||||
|
||||
+1
-10
@@ -37,10 +37,6 @@ import {
|
||||
COMPANY_DATA_SEED_COLUMNS,
|
||||
COMPANY_DATA_SEEDS,
|
||||
} from 'src/engine/workspace-manager/dev-seeder/data/constants/company-data-seeds.constant';
|
||||
import {
|
||||
CONNECTED_ACCOUNT_DATA_SEED_COLUMNS,
|
||||
CONNECTED_ACCOUNT_DATA_SEEDS,
|
||||
} from 'src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant';
|
||||
import {
|
||||
DASHBOARD_DATA_SEED_COLUMNS,
|
||||
getDashboardDataSeeds,
|
||||
@@ -163,14 +159,9 @@ const getRecordSeedsBatches = (
|
||||
pgColumns: DASHBOARD_DATA_SEED_COLUMNS,
|
||||
recordSeeds: getDashboardDataSeeds(workspaceId),
|
||||
},
|
||||
{
|
||||
tableName: 'connectedAccount',
|
||||
pgColumns: CONNECTED_ACCOUNT_DATA_SEED_COLUMNS,
|
||||
recordSeeds: CONNECTED_ACCOUNT_DATA_SEEDS,
|
||||
},
|
||||
];
|
||||
|
||||
// Batch 3: Depends on company, connectedAccount
|
||||
// Batch 3: Depends on company
|
||||
const batch3: RecordSeedConfig[] = [
|
||||
{
|
||||
tableName: 'person',
|
||||
|
||||
Reference in New Issue
Block a user