Initial commit carried over from private repo. This is V2.
This commit is contained in:
16
code/MessengerApi.Db.Npg.Migrator/Program.cs
Normal file
16
code/MessengerApi.Db.Npg.Migrator/Program.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace MessengerApi.Db.Npg.Migrator
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// You can use empty string to build the context when adding a migration - adding a migration does not hit the DB.
|
||||
|
||||
// DesignTimeDbFactory.ConnectionString.cs is not versioned on purposed. Add missing property file for this partial class and then run this command:
|
||||
// Add-Migration YourMigration -Project MessengerApi.Db.Npg -StartupProject MessengerApi.Db.Npg.Migrator -Verbose -Context MessengerNpgDbContext
|
||||
|
||||
// To update the database, make sure your connection string is correct and run this command:
|
||||
// Update-Database -Project MessengerApi.Db.Npg -StartupProject MessengerApi.Db.Npg.Migrator -Verbose -Context MessengerNpgDbContext
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user