CREATE TABLE IF NOT EXISTS tarifs_clients (
    id INT AUTO_INCREMENT PRIMARY KEY,
    client_id INT NOT NULL,
    article_id INT NOT NULL,
    prix_ht DECIMAL(12,2) NOT NULL DEFAULT 0,
    actif TINYINT(1) NOT NULL DEFAULT 1,
    date_creation DATETIME DEFAULT CURRENT_TIMESTAMP,
    date_modification DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE KEY uniq_tarif_client_article (client_id, article_id),
    INDEX idx_tarifs_clients_client (client_id),
    INDEX idx_tarifs_clients_article (article_id),
    CONSTRAINT fk_tarifs_clients_client FOREIGN KEY (client_id) REFERENCES clients(id),
    CONSTRAINT fk_tarifs_clients_article FOREIGN KEY (article_id) REFERENCES articles(id)
);
