Open Closed

Multi-Tenancy data migration within Oracle #8464


User avatar
0
dhaoo created
  • ABP Framework version: v8.1.3

  • UI Type: MVC

  • Database System: EF Core (Only for Oracle)

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes (Micro Service)

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

    I am using Oracle database. I have filled two connection string in the Database connection strings Modal as the following figure. One for Tenant and the other for Product Service. They both use Oracle. and then click "Save" button, but no two databases(table spaces) specified in Database connection strings are created.

    • Can the ABP Framework support creating oracle database(table spaces) if they don't exists?
    • How do I do if I want to migrate(Clone) data in a Job table into a tenant job table during the above Tenant data migration process?
    • What is the Best Practice for Mult-Tenancy Schema & Data Migration in Oracle ?


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

    hi

    click "Save" button, but no two databases(table spaces) specified in Database connection strings are created.

    The tenant dropdown menu has Apply database migrations options.

    You can click and check the logs to see what's happened.

    Can the ABP Framework support creating oracle database(table spaces) if they don't exists?

    Yes, ABP will use EF Core service to create a new database. see https://abp.io/docs/latest/framework/data/entity-framework-core/migrations

    How do I do if I want to migrate(Clone) data in a Job table into a tenant job table during the above Tenant data migration process?

    You can add a new event handle to migrate the data. There is an event when a tenant is created. IDistributedEventHandler<TenantCreatedEto>

    Please check your solution there should be have a event handler:

    public class MyProjectNameTenantDatabaseMigrationHandler :
        IDistributedEventHandler<TenantCreatedEto>,
        IDistributedEventHandler<TenantConnectionStringUpdatedEto>,
        IDistributedEventHandler<ApplyDatabaseMigrationsEto>,
        ITransientDependency
    {
    }
    

    What is the Best Practice for Mult-Tenancy Schema & Data Migration in Oracle ?

    see https://abp.io/docs/latest/framework/data/entity-framework-core/migrations

  • User Avatar
    0
    dhaoo created

    Thanks for your reply.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

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