Skip to content

Data Types not honoured on import #313

@RachBreeze

Description

@RachBreeze

Hello

We have a custom data type that currently holds an integer value in the database type. example uSync file below

<DataType Key="01e1a249-c283-4750-8334-abe8e531cb93" Alias="MyAlias" Level="2">
  <Info>
    <Name>MyName</Name>
    <EditorAlias>MyAlias</EditorAlias>
    <DatabaseType>Integer</DatabaseType>
    <Folder>MyFolder</Folder>
  </Info>
  <Config><![CDATA[{}]]></Config>
</DataType>

We are transforming this to contentment

The migration plan overrides the database type as shown

	public override string GetDatabaseType(SyncMigrationDataTypeProperty dataTypeProperty, SyncMigrationContext context)
		=> ValueStorageType.Ntext.ToString();

And GetContentValue is

public override string? GetContentValue(SyncMigrationContentProperty contentProperty, SyncMigrationContext context)
{
	if (contentProperty.Value == null)
	{
		return null;
	}
	return contentProperty.Value.ToString();
}

On export the config file correctly defines data base type as <DatabaseType>Ntext</DatabaseType>

On import the data remains in the intValue field in cmsPropertyType table.

Versions:

  • Umbraco 13.13.0
  • uSync 13.3.2
  • uSync.Migrations 4.0.0-phase.5.1

I know this can be resolved by moving to the Umbraco Migration plan, but the rest of the migrations are in uSync. Is there a way to transform on import? If not more than happy to resolve here in uSyncMigrations :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions