
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;

-- ---------------------------------------------------------------------
-- rib_client
-- ---------------------------------------------------------------------

DROP TABLE IF EXISTS `rib_client`;

CREATE TABLE `rib_client`
(
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `customer_id` INTEGER,
    `iban` VARCHAR(255),
    `bic` VARCHAR(255),
    `remarques` LONGTEXT,
    `mode_de_reglement` VARCHAR(255),
    `echeance` INTEGER(3),
    `net_ou_fdm` VARCHAR(255),
    PRIMARY KEY (`id`),
    INDEX `rib_client_FI_1` (`customer_id`),
    CONSTRAINT `rib_client_FK_1`
        FOREIGN KEY (`customer_id`)
        REFERENCES `customer` (`id`)
        ON UPDATE RESTRICT
        ON DELETE CASCADE
) ENGINE=InnoDB;

# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
