# ---------------------------------------------------------------------- #
# Script generated with: DeZign for Databases V7.3.4                     #
# Target DBMS:           MySQL 5                                         #
# Project file:          abliaDbComuni3.dez                              #
# Project name:          DB COMUNI - ABLIA                               #
# Author:                Andrea Colzi                                    #
# Script type:           Database creation script                        #
# Created on:            2014-11-20 11:01                                #
# ---------------------------------------------------------------------- #


# ---------------------------------------------------------------------- #
# Tables                                                                 #
# ---------------------------------------------------------------------- #

# ---------------------------------------------------------------------- #
# Add table "USER_CLIFOR"                                                #
# ---------------------------------------------------------------------- #

CREATE TABLE `USER_CLIFOR` (
    `id_userClifor` INTEGER NOT NULL AUTO_INCREMENT,
    `id_users` INTEGER,
    `id_clifor` INTEGER,
    CONSTRAINT `PK_USER_CLIFOR` PRIMARY KEY (`id_userClifor`)
);

# ---------------------------------------------------------------------- #
# Foreign key constraints                                                #
# ---------------------------------------------------------------------- #

ALTER TABLE `USER_CLIFOR` ADD CONSTRAINT `USERS_USER_CLIFOR` 
    FOREIGN KEY (`id_users`) REFERENCES `USERS` (`id_users`);

ALTER TABLE `USER_CLIFOR` ADD CONSTRAINT `CLIFOR_USER_CLIFOR` 
    FOREIGN KEY (`id_clifor`) REFERENCES `CLIFOR` (`id_clifor`);
