Bonjour,
j'ai quelques soucis dans la conception de ma BDD. J'utilise MySQL et lorsque j'utilise mon application web, j'ai (dans mon serveur JOnAS) les erreurs suivantes :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
08:24:37,027 DEBUG SchemaUpdate:149 - alter table t_gpco add index FKCB5D64008FB02E86 (id_gpco), add constraint FKCB5D64008FB6 foreign key (id_gpco) references t_domaine (id_domaine)
08:24:37,105 ERROR SchemaUpdate:155 - Unsuccessful: alter table t_gpco add index FKCB5D64008FB02E86 (id_gpco), add constraint B5D64008FB02E86 foreign key (id_gpco) references t_domaine (id_domaine)
08:24:37,105 ERROR SchemaUpdate:156 - Can't create table .\suivi_activite\#sql-7ec_92e.frm' (errno: 150)
08:24:37,105 DEBUG SchemaUpdate:149 - alter table t_groupe add index FK69B62BF1E8E6EC37 (id_groupe), add constraint FK69B62BF
6EC37 foreign key (id_groupe) references t_domaine (id_domaine)
08:24:37,199 ERROR SchemaUpdate:155 - Unsuccessful: alter table t_groupe add index FK69B62BF1E8E6EC37 (id_groupe), add constr FK69B62BF1E8E6EC37 foreign key (id_groupe) references t_domaine (id_domaine)
08:24:37,199 ERROR SchemaUpdate:156 - Can't create table '.\suivi_activite\#sql-7ec_92e.frm' (errno: 150)
Et voici la création des tables :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
-- 
-- Structure de la table `t_gpco`
-- 
 
CREATE TABLE `t_gpco` (
  `id_gpco` tinyint(4) NOT NULL auto_increment,
  `lib_gpco` varchar(20) character set latin1 collate latin1_general_cs NOT NULL,
  `id_domaine` int(4) NOT NULL,
  PRIMARY KEY  (`id_gpco`),
  KEY `t_gpco_ibfk_1` (`id_domaine`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
 
-- 
-- Structure de la table `t_groupe`
-- 
 
CREATE TABLE `t_groupe` (
  `id_groupe` tinyint(4) NOT NULL auto_increment,
  `lib_groupe` varchar(20) character set latin1 collate latin1_general_cs NOT NULL,
  `id_domaine` int(4) NOT NULL,
  PRIMARY KEY  (`id_groupe`),
  KEY `t_groupe_ibfk_1` (`id_domaine`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
 
-- 
-- Structure de la table `t_domaine`
-- 
 
CREATE TABLE `t_domaine` (
  `id_domaine` int(4) NOT NULL auto_increment,
  `lib_domaine` varchar(20) character set latin1 collate latin1_general_cs NOT NULL,
  `tab_name` varchar(20) NOT NULL,
  `espace_depot` varchar(250) NOT NULL,
  PRIMARY KEY  (`id_domaine`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
 
-- 
-- Contraintes pour la table `t_correspondance`
-- 
ALTER TABLE `t_correspondance`
  ADD CONSTRAINT `t_correspondance_ibfk_18` FOREIGN KEY (`id_groupe`) REFERENCES `t_groupe` (`id_groupe`) ON DELETE CASCADE,
  ADD CONSTRAINT `t_corresp_ibfk_19` FOREIGN KEY (`id_intervenant`) REFERENCES `t_intervenant` (`id_intervenant`) ON DELETE CASCADE;
 
-- 
-- Contraintes pour la table `t_gpco`
-- 
ALTER TABLE `t_gpco`
  ADD CONSTRAINT `t_gpco_ibfk_1` FOREIGN KEY (`id_domaine`) REFERENCES `t_domaine` (`id_domaine`) ON DELETE CASCADE;
 
-- 
-- Contraintes pour la table `t_groupe`
-- 
ALTER TABLE `t_groupe`
  ADD CONSTRAINT `t_groupe_ibfk_1` FOREIGN KEY (`id_domaine`) REFERENCES `t_domaine` (`id_domaine`) ON DELETE CASCADE;
J'ai l'impression que ma base n'est pas correctement conçue à 100% (et c'est pour ça que Hibernate essaie d'ajouter de nouvelles contraintes).
Pouvez- vous me dire si la base semble correcte ou au contraire, faut-il ajouter de nouvelles contraintes ?

Merci