<commit_before>CREATE TABLE notes.niveau_ens_complement
(
	id bigint NOT NULL,
	libelle character varying(50) NOT NULL,
	niveau int NOT NULL,
	bareme_brevet int NOT NULL,
	CONSTRAINT niveau_ens_compl_pk PRIMARY KEY(id)

);

INSERT INTO notes.niveau_ens_complement (id,libelle,niveau,bareme_brevet)
VALUES (1,'Objectif atteint',1,10),(2,'Objectif dépassé',2,20);
INSERT INTO notes.niveau_ens_complement(id, libelle, niveau, bareme_brevet)
	VALUES (3, 'aucun', 0, 0);

ALTER TABLE notes.niveau_competences ADD bareme_brevet int ;

UPDATE notes.niveau_competences SET bareme_brevet = 10 where ordre = 1;
UPDATE notes.niveau_competences SET bareme_brevet = 25 where ordre = 2;
UPDATE notes.niveau_competences SET bareme_brevet = 40 where ordre = 3;
UPDATE notes.niveau_competences SET bareme_brevet = 50 where ordre = 4;


ALTER TABLE notes.eleve_enseignement_complement RENAME COLUMN "niveau" TO "id_niveau";
ALTER TABLE notes.eleve_enseignement_complement ADD CONSTRAINT fk_niveau_id FOREIGN KEY(id_niveau)
 REFERENCES notes.niveau_ens_complement (id) MATCH SIMPLE
 ON UPDATE NO ACTION ON DELETE NO ACTION;<commit_msg>[MN-568]:Fix niveau_enseignement_complement : Script SQL null possible sur la colonne niveau et bareme<commit_after>CREATE TABLE notes.niveau_ens_complement
(
	id bigint NOT NULL,
	libelle character varying(50) NOT NULL,
	niveau int ,
	bareme_brevet int ,
	CONSTRAINT niveau_ens_compl_pk PRIMARY KEY(id)
);

INSERT INTO notes.niveau_ens_complement (id,libelle,niveau,bareme_brevet)
VALUES (1,'Objectif atteint',1,10),(2,'Objectif dépassé',2,20);
INSERT INTO notes.niveau_ens_complement(id, libelle, niveau, bareme_brevet)
	VALUES (3, 'aucun', 0, 0);

ALTER TABLE notes.niveau_competences ADD bareme_brevet int ;

UPDATE notes.niveau_competences SET bareme_brevet = 10 where ordre = 1;
UPDATE notes.niveau_competences SET bareme_brevet = 25 where ordre = 2;
UPDATE notes.niveau_competences SET bareme_brevet = 40 where ordre = 3;
UPDATE notes.niveau_competences SET bareme_brevet = 50 where ordre = 4;


ALTER TABLE notes.eleve_enseignement_complement RENAME COLUMN "niveau" TO "id_niveau";
ALTER TABLE notes.eleve_enseignement_complement ADD CONSTRAINT fk_niveau_id FOREIGN KEY(id_niveau)
 REFERENCES notes.niveau_ens_complement (id) MATCH SIMPLE
 ON UPDATE NO ACTION ON DELETE NO ACTION;
{'fraction_non_alphanumeric': 0.07335069444444445, 'fraction_numerical': 0.023003472222222224, 'mean_word_length': 6.657807308970099, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5710143', 'n_tokens_mistral': 867, 'n_tokens_neox': 817, 'n_words': 226}