Delimiter //
/**
 * Author:  armen
 * Created: 20 juil. 2020
 */
Drop Procedure if exists LOADER_CREATE_TABLE_CREDITPROVIDERS_ACCOUNTS//
Create Procedure LOADER_CREATE_TABLE_CREDITPROVIDERS_ACCOUNTS ()
Begin
    Drop Table If Exists LOADER_CREDITPROVIDERS_ACCOUNTS;
    Create Table LOADER_CREDITPROVIDERS_ACCOUNTS (
                ID_LOADER_CREDITPROVIDERS_ACCOUNTS Int Unsigned Not Null Auto_increment
                , LDR_CRDTPRVDRS_ID_LDR_CRDTPRVDRS Int Unsigned Not Null
                , LOADER_STATUS_ID_LOADER_STATUS Int Unsigned Not Null

                , ACCOUNTS_ID_ACCOUNTS Int Unsigned Not Null 

                , ID_CREDITS_PROVIDERS Int Unsigned Null
                , ID_CREDITS_PROVIDERS_NEW Int Unsigned Null

                , Primary Key (ID_LOADER_CREDITPROVIDERS_ACCOUNTS)
                , Index (LOADER_STATUS_ID_LOADER_STATUS)
                , Index (LDR_CRDTPRVDRS_ID_LDR_CRDTPRVDRS)
                , Index (ACCOUNTS_ID_ACCOUNTS)
            )
        ;
End //
Delimiter ;
call LOADER_CREATE_TABLE_CREDITPROVIDERS_ACCOUNTS();