DROP TABLE IF EXISTS sacoche_livret_dnb_matiere;

CREATE TABLE sacoche_livret_dnb_matiere (
  livret_dnb_matiere_id                TINYINT     UNSIGNED                NOT NULL,
  livret_dnb_matiere_code              CHAR(6)     COLLATE utf8_unicode_ci NOT NULL DEFAULT "" COMMENT "Masque à comparer avec <CODE_MATIERE> issu de SIECLE.",
  livret_dnb_modalite_election_code    CHAR(1)     COLLATE utf8_unicode_ci NOT NULL DEFAULT "" COMMENT "<CODE_MODALITE_ELECT> issu de SIECLE.",
  livret_dnb_matiere_obligatoire       TINYINT     UNSIGNED                NOT NULL DEFAULT 1,
  livret_dnb_matiere_dispense_possible TINYINT     UNSIGNED                NOT NULL DEFAULT 0,
  livret_dnb_matiere_nom               VARCHAR(70) COLLATE utf8_unicode_ci NOT NULL DEFAULT "",
  PRIMARY KEY (livret_dnb_matiere_id)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE sacoche_livret_dnb_matiere DISABLE KEYS;

INSERT INTO sacoche_livret_dnb_matiere VALUE
-- enseignements obligatoires
( 1, "0207.0", "S", 1, 0, "Français"),
( 2, "0613.0", "S", 1, 0, "Mathématiques"),
( 3, "0437.0", "S", 1, 0, "Histoire-géographie"),
( 4, "0421.0", "S", 1, 0, "Histoire-géographie et EMC"),
( 5, "03...1", "O", 1, 0, "Langue vivante 1"),
( 6, "03...2", "O", 1, 1, "Langue vivante 2"),
( 7, "0438.0", "S", 1, 0, "Enseignement moral et civique"),
( 8, "0629.0", "S", 1, 0, "Sciences de la vie et de la terre"),
( 9, "0623.0", "S", 1, 0, "Physique-chimie"),
(10, "0708.0", "S", 1, 0, "Technologie"),
(11, "0901.0", "S", 1, 0, "Arts plastiques"),
(12, "0813.0", "S", 1, 0, "Éducation musicale"),
(13, "0810.0", "S", 1, 0, "Éducation musicale générale et technique"),
(14, "1001.0", "S", 1, 1, "Éducation physique et sportive"),
(15, "0236.0", "F", 1, 0, "Langue et littérature"),
(16, "0738.0", "S", 1, 0, "Sciences et technologie"),
(17, "0711.0", "S", 1, 0, "Enseignement technologique professionnel"),
(18, "0074.0", "S", 1, 0, "Découverte professionnelle"),
(19, "0834.0", "S", 1, 0, "Enseignement artistique"),
(20, "3045.0", "S", 1, 0, "Biologie-écologie"),
(21, "4124.0", "S", 1, 0, "Technologie informatique et de communication"),
(22, "0005.0", "S", 1, 0, "Éducation socioculturelle"),
-- enseignements facultatifs
(24, "0843.0", "F", 0, 0, "Chant choral collectif"),
(25, "03...8", "F", 0, 0, "Langues et cultures européennes ou régionales"),
(26, "0203.0", "F", 0, 0, "Langues et cultures de l’antiquité - Latin"),
(27, "0204.0", "F", 0, 0, "Langues et cultures de l’antiquité - Grec"),
(28, "0240.0", "F", 0, 0, "Langues et cultures de l'antiquité - Latin Grec"),
(29, "0053.0", "F", 0, 0, "Langue des signes française"),
(30, "03...2", "F", 0, 0, "Langue vivante 2"),
(31, "......", "D", 0, 0, "Discipline Non Linguistique");

ALTER TABLE sacoche_livret_dnb_matiere ENABLE KEYS;
