title: Problems creating more schemas in PostgreSQL + .NET Core
body: <p>We recently created a web project in .NET Core and are using PostgreSQL via NPGSQL Entity Framework extension. At first, there were no problems at all. But when trying to add more schemas, the new schema was not created. According to other posts on the Internet, we should not be limited to any number of schemas. Does anybody know what might cause the problem?</p>
  
  <p>P.S.: After dropping the original schema, the new schema was successfully created. However, trying to add next schema without dropping the previous one seems like a problem.</p>
  
  <p>FooDbContext.cs</p>
  
  <pre><code>public class FooDbContext : DbContext
  {
      /// &lt;summary&gt;
      /// For unit testing.
      /// &lt;/summary&gt;
      public FooDbContext()
          : base()
      {
      }
  
      public FooDbContext(DbContextOptions&lt;FooDbContext&gt; options)
          : base(options)
      {
      }
  
      public virtual DbSet&lt;Person&gt; People { get; set; }
      public virtual DbSet&lt;Project&gt; Projects { get; set; }
      public virtual DbSet&lt;PersonOnProject&gt; PeopleOnProjects { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.HasDefaultSchema("TestingFoo");
          base.OnModelCreating(modelBuilder);
      }
  }
  </code></pre>
  
  <p>Startup.cs</p>
  
  <pre><code>...
  public void ConfigureServices(IServiceCollection services)
          {
              // Add framework services.
              services.AddEntityFrameworkNpgsql().AddDbContext&lt;Model.FooDbContext&gt;((provider, builder) =&gt; {
                  builder.UseNpgsql(Configuration.GetConnectionString("LocalDb"), b =&gt; b.MigrationsAssembly("TestingFoo"));
              });
              services.AddMvc();
          }
  
  ....
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
      {
          loggerFactory.AddConsole(Configuration.GetSection("Logging"));
          loggerFactory.AddDebug();
  
          app.ApplicationServices.GetService&lt;Model.FooDbContext&gt;().Database.EnsureCreated();
          app.Use(async (context, next) =&gt;
          {
              await next();
  
              if (context.Response.StatusCode == 404
                  &amp;&amp; !Path.HasExtension(context.Request.Path.Value))
              {
                  context.Request.Path = "/index.html";
                  await next();
              }
          });
  
          app.UseStaticFiles();
          app.UseMvc();
      }
  </code></pre>