Delimiter //
/**
 * Create Log' table
 * 
 * @author Jean-François
 */
Drop Procedure If Exists LOADER_CREATE_TABLE_LOGS//
Create Procedure LOADER_CREATE_TABLE_LOGS()
Begin

    Drop Table If Exists LOADER_LOGS;
    Create Table LOADER_LOGS (

        -- champs pour le traitements de l'import
        LOADER_STATUS_ID_LOADER_STATUS Integer Null,

        ID_LOADER_LOGS Integer Not Null Auto_Increment,
        LOADER_LOGS_SRC_TABLE_ID Integer Unsigned Null,
        LOADER_LOGS_BATCH_NUMM Integer Null,
        LOADER_LOGS_ERRCOUNT Int Not Null default 0, 
        LOADER_LOGS_ERRMSGS TEXT Null, 
        LOADER_LOGS_WARNCOUNT Int Not Null default 0, 
        LOADER_LOGS_WARNMSGS TEXT Null, 
        LOADER_LOGS_TYPE Varchar(50), 

        Primary Key (ID_LOADER_LOGS)
        , Index (LOADER_STATUS_ID_LOADER_STATUS)

    ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

End//
Delimiter ;
Call LOADER_CREATE_TABLE_LOGS();