DONATE:MySQL Dump version3

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `DONATE` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `DONATE` ;

-- - -- Table `DONATE`.`donor` -- - DROP TABLE IF EXISTS `DONATE`.`donor` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`donor` (  `donorID` INT NOT NULL AUTO_INCREMENT,  `street` VARCHAR(25) NULL ,  `city` VARCHAR(20) NULL ,  `state` VARCHAR(2) NULL ,  `zip` VARCHAR(10) NULL ,  `phone` VARCHAR(14) NULL ,  `fax` VARCHAR(14) NULL ,  `eMail` VARCHAR(30) NULL ,  PRIMARY KEY (`donorID`) ) ENGINE = InnoDB;

-- - -- Table `DONATE`.`donation` -- - DROP TABLE IF EXISTS `DONATE`.`donation` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`donation` (  `donation` INT NOT NULL AUTO_INCREMENT,  `donationDate` DATE NOT NULL ,  `donorID` INT NULL ,  `eventID` INT NULL ,  PRIMARY KEY (donation) ,  INDEX (donorID) ,    FOREIGN KEY (donorID)    REFERENCES donor (donorID)    ON DELETE NO ACTION    ON UPDATE NO ACTION,	INDEX (eventID) ,    FOREIGN KEY (eventID)    REFERENCES event(eventID)    ON DELETE NO ACTION    ON UPDATE NO ACTION) ENGINE = InnoDB;

-- - -- Table `DONATE`.`event` -- - DROP TABLE IF EXISTS `DONATE`.`event` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`event` (  `eventID` INT NOT NULL AUTO_INCREMENT,  `eventName` VARCHAR(50) NOT NULL ,  `eventDate` DATE NULL ,  `street` VARCHAR(25) NULL ,  `city` VARCHAR(15) NULL ,  `state` VARCHAR(2) NULL ,  `zip` VARCHAR(10) NULL ,  PRIMARY KEY (`eventID`) ) ENGINE = InnoDB;

-- - -- Table `DONATE`.`eventType` -- - DROP TABLE IF EXISTS `DONATE`.`eventType` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`eventType` (  `eventType` VARCHAR(50) NULL,  `eventName` VARCHAR(50) NOT NULL ,  `eventDescription` VARCHAR(200) NULL ,  PRIMARY KEY (eventType)) ENGINE = InnoDB;

-- - -- Table `DONATE`.`individual` -- - DROP TABLE IF EXISTS `DONATE`.`individual` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`individual` (  `donorID` INT NOT NULL,  `firstName` VARCHAR(20) NULL ,  `lastName` VARCHAR(20) NULL ,  PRIMARY KEY (donorID) ,  INDEX (donorID) ,    FOREIGN KEY (donorID)    REFERENCES donor(donorID)    ON DELETE NO ACTION    ON UPDATE NO ACTION) ENGINE = InnoDB;

-- - -- Table `DONATE`.`organization` -- - DROP TABLE IF EXISTS `DONATE`.`organization` ;

CREATE TABLE IF NOT EXISTS `DONATE`.`organization` (  `donorID` INT NOT NULL,  `organizationName` VARCHAR(100) NULL ,  `description` VARCHAR(100) NULL ,  PRIMARY KEY (donorID) ,  INDEX (donorID) ,    FOREIGN KEY (donorID)    REFERENCES donor (donorID)    ON DELETE NO ACTION    ON UPDATE NO ACTION) ENGINE = InnoDB;

SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;