camilleregnier / asptt-plongee

Automatically exported from code.google.com/p/asptt-plongee
0 stars 0 forks source link

creation des tables pour la G2R0 #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I) passer en innodb :
ALTER TABLE `asptt-marseille-plongee_fr_1`.`ADHERENT` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`PLONGEE` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`CONTACT_URGENT` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`INSCRIPTION_PLONGEE` ENGINE = 
InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`MESSAGE` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`LISTE_ATTENTE` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`REL_ADHERENT_CONTACT` ENGINE = 
InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`REL_ADHERENT_ROLES` ENGINE = InnoDB;
ALTER TABLE `asptt-marseille-plongee_fr_1`.`ROLES` ENGINE = InnoDB;

II)1- Création de la table REL_PARRAIN_FILLEUL :
CREATE TABLE IF NOT EXISTS `REL_PARRAIN_FILLEUL` (
  `idParrain` varchar(10) NOT NULL,
  `idFilleul` varchar(10) NOT NULL,
  `idPlongee` int(11) NOT NULL,
  PRIMARY KEY (`idParrain`,`idPlongee`,`idFilleul`),
  KEY `FK_FILLEUL` (`idFilleul`),
  KEY `FK_PLONGEE` (`idPlongee`)
) ENGINE=InnoDB;
II)2- Création des contraintes : 
ALTER TABLE `REL_PARRAIN_FILLEUL`
  ADD CONSTRAINT `FK_FILLEUL` FOREIGN KEY (`idFilleul`) REFERENCES `ADHERENT` (`LICENSE`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_PARRAIN` FOREIGN KEY (`idParrain`) REFERENCES `ADHERENT` (`LICENSE`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `FK_PLONGEE` FOREIGN KEY (`idPlongee`) REFERENCES `PLONGEE` (`idPLONGEES`) ON DELETE NO ACTION ON UPDATE NO ACTION;

III)1- Création de la table de sequence pour les externes : 
create table SEQUENCE_EXT (id_ext INT NOT NULL);
III)2- init de la table à 300 : 
insert into SEQUENCE_EXT values (300);

Original issue reported on code.google.com by simon.eric028@gmail.com on 3 Oct 2012 at 11:12

GoogleCodeExporter commented 9 years ago

Original comment by camille....@gmail.com on 16 Sep 2014 at 2:11