 CREATE TABLE TAGS(
 	art INTEGER REFERENCES ARTICLE(id),
 	word VARCHAR(100),
+	modi CHAR(7) REFERENCES TUSER(login),
 	PRIMARY KEY(art,word)
 );
 

CREATE TABLE RUBRIQUE_ARTICLE(
	rub VARCHAR(50) REFERENCES RUBRIQUE(title),
	art INTEGER REFERENCES ARTICLE(id),
	PRIMARY KEY(rub, art)
);


--------L'HISTORIQUE DE CREATION DE LIEN ENTRE DEUX ARTICLES
CREATE OR REPLACE FUNCTION process_tr_historique_article2() RETURNS TRIGGER AS $tr_historique_article2$
    BEGIN
		INSERT INTO HISTORIQUE_ARTICLE(id, art, aDate, login, aAction ) VALUES (nextval('idauto_his_art'), NEW.firstArticle ,current_timestamp,NEW.modi,'lier_article');
		INSERT INTO HISTORIQUE_ARTICLE(id, art, aDate, login, aAction ) VALUES (nextval('idauto_his_art'), NEW.secondArticle ,current_timestamp,NEW.modi,'lier_article');
		RETURN NULL;
    END;
$tr_historique_article2$ LANGUAGE plpgsql VOLATILE;
