title: EF Core Relation doesn't exist
body: <p>I want to create a database in PostgreSQL and API for my app. I've created Model and API in EF Core 1.0.0. Model exists in separate library.</p>
  
  <pre><code>public class Architect : IEntity
  {
      public Guid Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string PhoneNumber { get; set; }
      public string Email { get; set; }
      public ICollection&lt;Project&gt; Projects { get; set; }
  }
  
  public class Project : IEntity
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
      [JsonConverter(typeof(IsoDateTimeConverter))]
      public DateTimeOffset CreatedAt { get; set; }
      public ICollection&lt;Company&gt; Companies { get; set; }
      public string City { get; set; }
      public ICollection&lt;ProjectState&gt; ProjectStates { get; set; }
      public Guid ArchitectId { get; set; }
      public Architect Architect { get; set; }
  }
  
  public class Company : IEntity
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
      public Guid ProjectId { get; set; }
      public Project Project { get; set; }
  }
  
   public class ProjectState : IEntity
  {
      public Guid Id { get; set; }
      public ProjectPhase phase { get; set; }
      public DateTime StartDate { get; set; }
      public DateTime EndDate { get; set; }
      public Guid ProjectId { get; set; }
      public Project Project { get; set; }
  }
  </code></pre>
  
  <p>I have created also DemoContext that inherits DbContext. I defined relashionships in OnModelCreating(ModelBuilder modelBuilder) method.</p>
  
  <pre><code>public class DemoContext : DbContext
  {
      public DbSet&lt;Architect&gt; Architects { get; set; }
      public DbSet&lt;Project&gt; Projects { get; set; }
      public DbSet&lt;Company&gt; Companies { get; set; }
      public DbSet&lt;ProjectState&gt; ProjectStates { get; set; }
  
      public DemoContext(DbContextOptions&lt;DemoContext&gt; options) : base(options) { }
  
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
          optionsBuilder.UseNpgsql("PORT = 5432; HOST = localhost; TIMEOUT = 15; POOLING = True; MINPOOLSIZE = 1; MAXPOOLSIZE = 20; COMMANDTIMEOUT = 20; DATABASE = ProgressTest; PASSWORD = 'postgres'; USER ID = postgres", b =&gt; b.MigrationsAssembly("WebAPI.API"));
      }
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.HasPostgresExtension("uuid-ossp");
  
          modelBuilder.Entity&lt;Project&gt;()
              .HasOne(p =&gt; p.Architect)
              .WithMany(a =&gt; a.Projects)
              .HasForeignKey(p=&gt;p.ArchitectId);
  
          modelBuilder.Entity&lt;ProjectState&gt;()
              .HasOne(p =&gt; p.Project)
              .WithMany(p =&gt; p.ProjectStates)
              .HasForeignKey(p =&gt; p.ProjectId);
  
          modelBuilder.Entity&lt;Company&gt;()
              .HasOne(c =&gt; c.Project)
              .WithMany(p =&gt; p.Companies)
              .HasForeignKey(c =&gt; c.ProjectId);
      }
  }
  </code></pre>
  
  <p>I want to migrate all classes and create new database. I've used
  <em>dotnet ef migrations add InitializeMigration</em> to add new migration and after it I wanted to update my database, so I've used <em>dotnet ef database update</em> but Postgres throw an Exception: </p>
  
  <pre><code>Npgsql.PostgresException: 42P01: relationship "ProjectState.IX_ProjectState_ProjectId" doesn't exist
  </code></pre>
  
  <p>Can you help me with it?</p>