CREATE TABLE IF NOT EXISTS unites_articles (
    id INT AUTO_INCREMENT PRIMARY KEY,
    libelle VARCHAR(50) NOT NULL UNIQUE,
    actif TINYINT(1) NOT NULL DEFAULT 1,
    date_creation DATETIME DEFAULT CURRENT_TIMESTAMP,
    date_modification DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

INSERT INTO unites_articles (libelle)
SELECT 'Unité'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Unité'
);

INSERT INTO unites_articles (libelle)
SELECT 'Litre'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Litre'
);

INSERT INTO unites_articles (libelle)
SELECT 'Kilogramme'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Kilogramme'
);

INSERT INTO unites_articles (libelle)
SELECT 'Carton'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Carton'
);

INSERT INTO unites_articles (libelle)
SELECT 'Bidon'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Bidon'
);

INSERT INTO unites_articles (libelle)
SELECT 'Boîte'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Boîte'
);

INSERT INTO unites_articles (libelle)
SELECT 'Rouleau'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Rouleau'
);

INSERT INTO unites_articles (libelle)
SELECT 'Sac'
WHERE NOT EXISTS (
    SELECT 1 FROM unites_articles WHERE libelle = 'Sac'
);