mirror of
https://github.com/rmcrackan/Libation.git
synced 2025-12-23 22:17:52 -05:00
Supporting postgres simplifies deployments to environments such as kubernetes. Since sqlite doesn't work well on nfs shares it can be easier for databases to have a dedicated db set up that applications can connect to. Sqlite is easier for most deployments though, so this will default to that if the settings haven't been updated to support it. This change does the following: - Separate out SQLite from the DataLayer and adds a Postgres assembly for migrations as well - Add a configuration setting for a postgres connection string that will be used if it is there, otherwise reverts to the original sqlite string - Add a copydb command for the cli to bootstrap the postgres db - A convenience script to update migrations for both dbs at the same time
13 lines
331 B
C#
13 lines
331 B
C#
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace DataLayer.Postgres
|
|
{
|
|
public class PostgresContextFactory : IDesignTimeDbContextFactory<LibationContext>
|
|
{
|
|
public LibationContext CreateDbContext(string[] args)
|
|
{
|
|
return LibationContextFactory.CreatePostgres(string.Empty);
|
|
}
|
|
}
|
|
}
|