There bug in SchemaUpgrade: My model:

[Serializable]
[HierarchyRoot]
public class MyEntity : Entity
{
    [Field, Key]
    public int Id { get; private set; }

    [Field(Length = 100)]
    public string Text { get; set; }

    [Field]
    public LinkeEntity Link { get; set; }
}

[HierarchyRoot]
public class LinkeEntity : Entity
{
    [Field, Key]
    public int Id { get; private set; }

    [Field(Length = 100)]
    public string Text { get; set; }
}

Build this model on Recreate to create database schema

Rename field public LinkeEntity Link { get; set; } to Link2

Try to Build domain with PerformSafely using upgrade handler:

public class Upgrader : UpgradeHandler
{
    protected override void AddUpgradeHints(Xtensive.Core.Collections.ISet<UpgradeHint> hints)
    {
        base.AddUpgradeHints(hints);
        hints.Add(new RenameFieldHint(typeof(MyEntity), "Link", "Link2"));
    }

    public override bool CanUpgradeFrom(string oldVersion)
    {
        return true;
    }
}

It works ok, if I use standart config, but if I change NamingConvention.NamingRules

        var config = DomainConfiguration.Load("Default");
        config.NamingConvention.NamingRules = NamingRules.UnderscoreDots;

Upgrade fails

asked Jan 19 '11 at 09:14

pil0t's gravatar image

pil0t
207575763


One Answer:

To be fixed :/

answered Jan 19 '11 at 14:03

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

The issue is fixed in the latest build.

(Feb 18 '11 at 00:50) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA