Open Closed

Update database migration remove all tables of module database and create again #4666


User avatar
0
isteer created

Hello Team,

OUR ABP CONFIGURATION:

ABP Framework version: v7.0.0 UI type: MVC DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): Tiered MVC Exception message and stack trace

We have deployed our ABP application on IIS server, we have tiered MVC application so we hosted all ports:

Auth server (port - 44349) : hosted on https://authserver.stage.careermaps.co.uk/ on IIS

Swagger (port- 44324) : hosted on https://host.stage.careermaps.co.uk/

Web-App (port 44389) : hosted on https://web.stage.careermaps.co.uk/

ISSUE:

  1. We have two database one is Main ABP database and other database is module database. Whenever we run migration from http.api.host to update module database, it shows error that table already exists.

we are using this command to run migration in host project to update module database :

dotnet ef database update --no-drop --context CareerMapsHttpApiHostMigrationsDbContext

Is there anyway we can only run migration for addition of new tables or updated columns rather than deleting all tables and create again?

This is the link we initially referred to create separate database for separate module : https://blog.antosubash.com/posts/abp-add-new-module-with-seperate-db

Thanks


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Did you migration database by using the DbMigrator project?

  • User Avatar
    0
    isteer created

    No we are using host application to run migration. How can we use dbmigrator project for our careermaps module that we added which has separate database?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Migrations

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07