add check db is not there create db not there same as table
This commit is contained in:
@@ -123,7 +123,16 @@ using (var scope = app.Services.CreateScope())
|
|||||||
//if (!databaseCreator.Exists())
|
//if (!databaseCreator.Exists())
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
databaseCreator.CreateTables();
|
// Check if database exists
|
||||||
|
if (!databaseCreator.Exists())
|
||||||
|
{
|
||||||
|
databaseCreator.Create();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!databaseCreator.HasTables())
|
||||||
|
{
|
||||||
|
databaseCreator.CreateTables();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
"Secret": "Super Secret SIGN AND VERIFY JWT TOKENS, BEARER TOKEN USE WHEN CALLING THIS API.",
|
"Secret": "Super Secret SIGN AND VERIFY JWT TOKENS, BEARER TOKEN USE WHEN CALLING THIS API.",
|
||||||
"SQLConnectionString_i": "host=localhost;port=5432;database=FamilyTreeDB_prod;username=postgres;password=Positive~1;",
|
"SQLConnectionString_i": "host=localhost;port=5432;database=FamilyTreeDB_prod;username=postgres;password=Positive~1;",
|
||||||
"SQLConnectionString": "host=192.168.1.240;port=5432;database=FamilyTreeDB;username=postgres;password=Positive~1;",
|
"SQLConnectionString": "host=192.168.1.240;port=5432;database=FamilyTreeDB_prod;username=postgres;password=Positive~1;",
|
||||||
|
|
||||||
"ImageFolder": "c:\\temp\\Family",
|
"ImageFolder": "c:\\temp\\Family",
|
||||||
"ImportFolder": "c:\\temp"
|
"ImportFolder": "c:\\temp"
|
||||||
|
|||||||
Reference in New Issue
Block a user