Delimiter //
/**
 * Author:  armen
 * Created: 27 juil. 2017
 */
Drop Procedure if exists LOADER_CREATE_TABLE_EDMINDEX_DOCUMENTS_HAS_KEYWORDS//
Create Procedure LOADER_CREATE_TABLE_EDMINDEX_DOCUMENTS_HAS_KEYWORDS()
Begin

    DROP TABLE IF EXISTS LOADER_EDMINDEX_DOCUMENTS_HAS_KEYWORDS;

    CREATE TABLE IF NOT EXISTS LOADER_EDMINDEX_DOCUMENTS_HAS_KEYWORDS (
        -- champs pour le traitements de l'import
        LOADER_STATUS_ID_LOADER_STATUS Int Not Null
        , LOADER_EDMINDEX_ID_LOADER_EDMINDEX Int Not Null
		
		, DF_KEYWORDS_CODE varchar(15) Not Null
        , ID_DF_KEYWORDS int(10) unsigned NULL

		, LOADER_EDMINDEX_KEYWORDS_TREATED Int Not Null Default 0

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

End//
Delimiter ;
CALL LOADER_CREATE_TABLE_EDMINDEX_DOCUMENTS_HAS_KEYWORDS();
