Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix seeds #7543

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const getDevSeedCompanyCustomFields = (
icon: 'IconAdCircle',
isActive: true,
isNullable: false,
defaultValue: "''",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: The default value for 'tagline' is set to an empty string. Ensure this is the intended behavior and doesn't conflict with the 'isNullable: false' setting.

objectMetadataId,
},
{
Expand Down Expand Up @@ -98,7 +99,7 @@ export const getDevSeedPeopleCustomFields = (
description: "Contact's Whatsapp Number",
icon: 'IconBrandWhatsapp',
isActive: true,
isNullable: false,
isNullable: true,
Copy link
Member

@Weiko Weiko Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could remain false since you set a default value? up to you!

objectMetadataId,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.
import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util';
import { WorkspaceMigrationRunnerService } from 'src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.service';
import { ViewFieldWorkspaceEntity } from 'src/modules/view/standard-objects/view-field.workspace-entity';
import { isDefined } from 'src/utils/is-defined';

import { FieldMetadataValidationService } from './field-metadata-validation.service';
import {
Expand Down Expand Up @@ -746,7 +747,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
}

if (!fieldMetadataInput.isNullable) {
if (!fieldMetadataInput.defaultValue) {
if (!isDefined(fieldMetadataInput.defaultValue)) {
throw new FieldMetadataException(
'Default value is required for non nullable fields',
FieldMetadataExceptionCode.INVALID_FIELD_INPUT,
Expand Down
Loading