public void EraseAllData()
        {
            var helper = new DbSchemaContextHelper("prod");

            DatabaseContext = new JobAssistantContext(helper.Options);
            try
            {
                DatabaseContext.Database.ExecuteSqlCommand(
                    "DELETE FROM Accessories; DELETE FROM Tools; DELETE FROM Applications; DELETE FROM Materials; DELETE FROM Jobs; DELETE FROM Categories; DELETE FROM Trades;");
                _logger.LogInformation(
                    "Successfully erased ALL data from tables: 'Accessories', 'Tools', 'Applications', 'Materials', 'Jobs', 'Categories', 'Trades'");
            }
            catch (Exception exception)
            {
                _logger.LogError("Exception thrown during execution of SQL DELETE FROM: " + exception);
            }
        }
 public void CreateSchema()
 {
     using (_logger.BeginScope(typeof(DbSchemaManager)))
     {
         var helper = new DbSchemaContextHelper("prod" /* production database instance */);
         DatabaseContext = new JobAssistantContext(helper.Options);
         try
         {
             DatabaseContext.Database.EnsureCreated();
             _logger.LogInformation("Successfully created table-based database schema for DB: {0}",
                                    DatabaseContext.Database.GetDbConnection().Database);
         }
         catch (Exception e)
         {
             _logger.LogError("Exception thrown during database schema creation: " + e);
         }
     }
 }
        public void DropSchema()
        {
            var helper = new DbSchemaContextHelper("prod");

            DatabaseContext = new JobAssistantContext(helper.Options);
            try
            {
                DatabaseContext.Database.EnsureDeleted();
                _logger.LogInformation("Successfully dropped or deleted schema via EF API mechanism: {0}.",
                                       DatabaseContext.Database.GetDbConnection().Database);
            }
            catch (MySqlException sqlException)
            {
                _logger.LogError("Exception thrown during MySQL database schema drop or delete: " + sqlException);
            }
            catch (Exception e)
            {
                _logger.LogError("Exception thrown during database schema delete step: " + e);
            }
        }