title: StarSchema - Entity Framework Core - Migration
body: <p>I am trying to build a datawarehouse (DWH), using the code-first approach (star-schema):</p>
  <p>Fact-/dimension classes:</p>
  <pre><code>    [Table(&quot;FactBase&quot;)]
      public class FactBase
      {
          [Key]
          public Guid Id { get; set; }
  
          [ForeignKey(&quot;DimTest1&quot;)]
          public string DimDigitalesBuchISBN { get; set; }
  
          public virtual DimTest1 DimTest1 { get; set; }  
      }
  
  
      [Table(&quot;DimTest1&quot;)]
      public class DimTest1
      {
          [Key]
          public string ISBN { get; set; }
  
          public string Bla { get; set; }
      }
  </code></pre>
  <p>Context:</p>
  <pre><code>public class XDBContextDWH : DbContext
  {      
      public DbSet&lt;FactBase&gt; FactBase { get; set; }
      public DbSet&lt;DimTest1&gt; DimTest1 { get; set; }
  
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
          optionsBuilder.UseSqlServer(new string(&quot;connection string&quot;));
      }
  }   
  </code></pre>
  <p>After using migration the schema looks like this:</p>
  <p><a href="https://i.stack.imgur.com/qddE6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qddE6.png" alt="Here" /></a></p>
  <p>Based on that <a href="https://www.etl-tools.com/images/Articles/Star%20Schema.png" rel="nofollow noreferrer">star schema</a>, shouldn't be the relationship (here: <a href="https://justpaste.it/8w9tk" rel="nofollow noreferrer">SQL</a>) like that?</p>
  <p><a href="https://i.stack.imgur.com/tWs5B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tWs5B.png" alt="here" /></a></p>