Add deleteOneObject mutation (#3682)
* Add deleteOneObject mutation * codegen * move relationToDelete to dedicated file --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -3,7 +3,12 @@ import { ObjectMetadataInterface } from 'src/metadata/field-metadata/interfaces/
|
||||
export const computeObjectTargetTable = (
|
||||
objectMetadata: ObjectMetadataInterface,
|
||||
) => {
|
||||
const prefix = objectMetadata.isCustom ? '_' : '';
|
||||
|
||||
return `${prefix}${objectMetadata.nameSingular}`;
|
||||
return computeCustomName(
|
||||
objectMetadata.nameSingular,
|
||||
objectMetadata.isCustom,
|
||||
);
|
||||
};
|
||||
|
||||
export const computeCustomName = (name: string, isCustom: boolean) => {
|
||||
return isCustom ? `_${name}` : name;
|
||||
};
|
||||
|
||||
@ -113,6 +113,9 @@ export class WorkspaceMigrationRunnerService {
|
||||
tableMigration?.columns,
|
||||
);
|
||||
break;
|
||||
case 'drop':
|
||||
await queryRunner.dropTable(`${schemaName}.${tableMigration.name}`);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
`Migration table action ${tableMigration.action} not supported`,
|
||||
|
||||
Reference in New Issue
Block a user