Code Monkey home page Code Monkey logo

Comments (1)

rayrfan avatar rayrfan commented on July 17, 2024

I have dropped support for sqlite, I can concentrate on development more, don't have to switch between sql server and sqlite to test both.

I have come back to a single dbcontext that controls every entity in the entire solution, but this time I used reflection to find and load these entities, mappings dynamically.

To add a migration, open Package Manager

  1. select "src\Fan" as the Default project
    Add-Migration FanSchemaV1
    This will add a new folder "Fan/Migrations" with a migration named FanSchemaV1

  2. ctrl + f5, the site is up running with db automatically created

  3. Add a property to Post class, say public int SortOrder { get; set; }
    Add-Migration FanSchemaV1_Add_SortOrder
    This will add a new migration.

  4. ctrl + f5, site is up running with Post table have new column SortOrder added automatically in db

Any changes to db can now be down with Add-Migration and just run the app. If I want to get the sql script running behind each migration, I can run Script-Migration [-Idempotent] to review.

from fanray.

Related Issues (20)

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.