Delimiter //
/**
 *  Table for import of Entries has Attached Document
 */
Drop Procedure if exists LOADER_CREATE_TABLE_EDMINDEX_ENTRIES_HAS_DOCUMENTS//
Create Procedure LOADER_CREATE_TABLE_EDMINDEX_ENTRIES_HAS_DOCUMENTS()
Begin

    DROP TABLE IF EXISTS LOADER_EDMINDEX_ENTRIES_HAS_DOCUMENTS;

    CREATE TABLE IF NOT EXISTS LOADER_EDMINDEX_ENTRIES_HAS_DOCUMENTS (
        -- champs pour le traitements de l'import
        LOADER_STATUS_ID_LOADER_STATUS Int Not Null

        , LOADER_EDMINDEX_ID_LOADER_EDMINDEX int(10) unsigned NOT NULL
        , ENTRIES_ID_ENTRIES int(10) unsigned NOT NULL

        , Index (LOADER_STATUS_ID_LOADER_STATUS)
        , Index (LOADER_EDMINDEX_ID_LOADER_EDMINDEX)
        , Index (ENTRIES_ID_ENTRIES)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=0;

End//
Delimiter ;
CALL LOADER_CREATE_TABLE_EDMINDEX_ENTRIES_HAS_DOCUMENTS();