I have some migration questions:

Removing class with many to many relationship

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

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

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

    [Field]
    public EntitySet<MyEntity> MyEntities { get; private set; }
  }

I want to remove the 'MyGroup' class : I'm adding an upgrade hint with 'MyGroup' type but I get this exception at domain build:

Extracted schema is not equal to the target schema. Details:
Schema comparison result: TargetIsSubset
Has unsafe actions: true
Has column type changes: false 
Compatible in ValidateLegacy mode: unknown

Unsafe actions:
  RemoveNode, Path=Tables/MyGroup-MyEntities-MyEntity

Removing an inner class

Is it possible to document the syntax for removing an inner class in manual?

For example you have to use the '+' character to remove an inner class.

hints.Add(new RemoveTypeHint("Test.MyEntity+MyInnerEntity"));

asked Jul 16 '12 at 06:37

olorin's gravatar image

olorin
358878792


One Answer:

Hello olorin,

Could you try registering a RemoveTypeHint for the intermediate class also? The full type name can be found in Metadata.Types table.

Hope that helps.

answered Jul 17 '12 at 09:50

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

It does indeed work with hints.Add(new RemoveTypeHint("TestDoMigration.Model.EntitySetItems.MyGroup-MyEntities-MyEntity")); Thanks!

(Jul 18 '12 at 03:46) olorin olorin'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