GithubHelp home page GithubHelp logo

martymcflaye / younited.healthcheck.entityframeworkmigrations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from younitedcredit/younited.healthcheck.entityframeworkmigrations

0.0 0.0 0.0 722 KB

Add a validation that all Entity Framework migrations have been executed, for a given DbContext, to the list of webapi healthchecks collection

License: MIT License

C# 100.00%

younited.healthcheck.entityframeworkmigrations's Introduction

Younited Credit netcore Entity Framework healthcheck library

The purpose of this project is to add a validation that all Entity Framework core migrations have been executed, for a given DbContext, to the list of webapi healthchecks collection

Getting Started

  1. Setup health checks for your webapp, as explained in this article

  2. Add reference to the Younited.HealthCheck.EntityFrameworkMigrations nuget to your webapp project

  3. Publish a health check for your EntityFramework DbContext

services.AddHealthChecks()
    .AddEntityFrameworkMigrationsCheck<SampleDbContext>() // Registers required services and check the pipeline

    // And all the other checks you may need for your app
    .AddCheck<PingHealthChecker>(nameof(PingHealthChecker));

You can refer to the sample app setup for further reference

Once the setup is done, you shall receive missing migrations as part of the health detailed status

{
    "status": "Unhealthy",
    "totalDuration": "00:00:05.9933318",
    "entries": {
        
        "SampleDbContextMigrationsHealthCheck": {
            "data": {
                "MissingMigrations": [
                    "20200531210738_MissingMigration"
                ]
            },
            "description": "1 migrations were not executed on the DB",
            "duration": "00:00:05.9883966",
            "status": "Unhealthy"
        },

        "PingHealthChecker": {
            "data": {},
            "description": "Ping Check",
            "duration": "00:00:00.0001120",
            "status": "Healthy"
        }
    }
}

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Contributor Covenant

younited.healthcheck.entityframeworkmigrations's People

Contributors

guillaumeguerra avatar greybird avatar bhugot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.