Tenant Data Deletion

Idea created by pedrojramalho on Dec 5, 2017
    Not planned
    • RicardoLimaNeves
    • PVilares
    • carlos-b-lopes
    • rjrodrigues_PT
    • pedrojramalho

    When we need to delete tenant data pdm_tenant_delete command is available to help with the task:


    D:\>pdm_tenant_delete -Q -t mytenantname

    Are you sure you want to delete data for tenant 'mytenantname' ? (yes/no) yes

    Are the constraints dropped ? (yes/no) yes

    Table Name: NR_Comment Number of rows processed: 283

    Number of rows succeeded: 283

    Number of rows failed: 0 T

    able Name: usp_ci_act_log

    Number of rows processed: 24

    Number of rows succeeded: 24

    Number of rows failed: 0

    Program completed.



    Bold words are the input required by administrator so the command can execute. 


    If the administrator wants to delete data for few tenants there's no problem in writing yes a couple of times. However, if the task is regarding several tenants the input required by administrator would transform this simple process in an inefficient method to clean up that data. Also, it would difficult to schedule this process to run outside working hours.


    My suggestion is to change pdm_tenant_delete so it can consider several tenants in an input clause. Example: pdm_tenant_delete -Q -t ('mytenant1','mytenant2','mytenant3')


    Thank you!