diff --git a/.gitignore b/.gitignore index 549e00a..2ea2eec 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ build/ ### VS Code ### .vscode/ +/.idea/ +/src/main/resources/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 6f8f4ad..a8c4885 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,7 +6,6 @@ - diff --git a/.idea/misc.xml b/.idea/misc.xml index 53931a6..06e8b35 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,8 +1,5 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11 \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c487121..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index b24858b..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,10 +1,6 @@ -<<<<<<< HEAD - -======= ->>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11 \ No newline at end of file diff --git a/pom.xml b/pom.xml index f417ba8..32eb628 100644 --- a/pom.xml +++ b/pom.xml @@ -51,4 +51,4 @@ - + \ No newline at end of file diff --git a/src/main/java/fr/organizee/controller/MembreController.java b/src/main/java/fr/organizee/controller/MembreController.java new file mode 100644 index 0000000..d96e0a9 --- /dev/null +++ b/src/main/java/fr/organizee/controller/MembreController.java @@ -0,0 +1,94 @@ +package fr.organizee.controller; + +import fr.organizee.model.Membre; +import fr.organizee.model.Team; +import fr.organizee.repository.MembreRepository; +import fr.organizee.repository.TeamRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Optional; + +/* toto */ +@RestController +@CrossOrigin("*") +public class MembreController { + + @Autowired + private MembreRepository membreRepo; + + @Autowired + private TeamRepository teamRepo; + + @GetMapping("/") + @ResponseBody + public String home() + { + StringBuilder sb = new StringBuilder(); + sb.append("

Affichages des membres

"); + sb.append("
  • Liste des membres
  • "); + return sb.toString(); + } + + @GetMapping(value = "/membres/all") + public ResponseEntity getAll(){ + List liste = null; + try + { + liste = membreRepo.findAll(); + } catch (Exception e) { + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null); + } + + return ResponseEntity.status(HttpStatus.OK).body(liste); + } + + @GetMapping(value = "/team/all") + public ResponseEntity getAllTeam(){ + List liste = null; + try + { + liste = teamRepo.findAll(); + } catch (Exception e) { + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null); + } + + return ResponseEntity.status(HttpStatus.OK).body(liste); + } + + @GetMapping(value = "/membres/{id}") + public ResponseEntity findById(@PathVariable int id){ + Optional membre = null; + try + { + membre = membreRepo.findById(id); + } catch (Exception e) { + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null); + } + + return ResponseEntity.status(HttpStatus.OK).body(membre); + } + + @GetMapping(value = "/membres/delete/{id}") + public void deleteMembreId(@PathVariable("id") Integer id) { + + membreRepo.deleteById(id); + + } + + @GetMapping(value = "/team/{id}") + public ResponseEntity findTeamById(@PathVariable int id){ + Optional liste = null; + try + { + liste = teamRepo.findById(id); + } catch (Exception e) { + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null); + } + + return ResponseEntity.status(HttpStatus.OK).body(liste); + } +} diff --git a/src/main/java/fr/organizee/model/Contact.java b/src/main/java/fr/organizee/model/Contact.java new file mode 100644 index 0000000..38a8111 --- /dev/null +++ b/src/main/java/fr/organizee/model/Contact.java @@ -0,0 +1,101 @@ +package fr.organizee.model; + +import javax.persistence.*; +import java.time.LocalDate; + +@Entity +public class Contact { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String nom; + private String prenom; + private String telephone; + private String email; + private String adresse; + private LocalDate dateNaissance; +/* @ManyToOne(fetch= FetchType.EAGER) + @JoinColumn(name="TEAM_ID") + private Team team;*/ + + public Contact() { + } + + public Contact(String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance) { + this.nom = nom; + this.prenom = prenom; + this.telephone = telephone; + this.email = email; + this.adresse = adresse; + this.dateNaissance = dateNaissance; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getNom() { + return nom; + } + + public void setNom(String nom) { + this.nom = nom; + } + + public String getPrenom() { + return prenom; + } + + public void setPrenom(String prenom) { + this.prenom = prenom; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getAdresse() { + return adresse; + } + + public void setAdresse(String adresse) { + this.adresse = adresse; + } + + public LocalDate getDateNaissance() { + return dateNaissance; + } + + public void setDateNaissance(LocalDate dateNaissance) { + this.dateNaissance = dateNaissance; + } + + @Override + public String toString() { + return "Contact{" + + "id=" + id + + ", nom='" + nom + '\'' + + ", prenom='" + prenom + '\'' + + ", telephone='" + telephone + '\'' + + ", email='" + email + '\'' + + ", adresse='" + adresse + '\'' + + ", dateNaissance=" + dateNaissance + + '}'; + } +} diff --git a/src/main/java/fr/organizee/model/Membre.java b/src/main/java/fr/organizee/model/Membre.java index a3a0d96..7924e70 100644 --- a/src/main/java/fr/organizee/model/Membre.java +++ b/src/main/java/fr/organizee/model/Membre.java @@ -3,6 +3,7 @@ package fr.organizee.model; import javax.persistence.*; import java.time.LocalDate; + @Entity public class Membre { @Id @@ -14,8 +15,107 @@ public class Membre { private String email; private String password; private String isAdmin; - private String testGit; - @ManyToOne(fetch= FetchType.EAGER) + private String couleur; + private String smiley; + @ManyToOne @JoinColumn(name="TEAM_ID") private Team team; + + public Membre() { + } + + public Membre(String nom, String prenom, LocalDate dateNaissance, String email, String password, String isAdmin, String couleur, String smiley, Team team) { + this.nom = nom; + this.prenom = prenom; + this.dateNaissance = dateNaissance; + this.email = email; + this.password = password; + this.isAdmin = isAdmin; + this.couleur = couleur; + this.smiley = smiley; +/* this.team = team;*/ + } + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getNom() { + return nom; + } + public void setNom(String nom) { + this.nom = nom; + } + public String getPrenom() { + return prenom; + } + public void setPrenom(String prenom) { + this.prenom = prenom; + } + public LocalDate getDateNaissance() { + return dateNaissance; + } + public void setDateNaissance(LocalDate dateNaissance) { + this.dateNaissance = dateNaissance; + } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + public String getIsAdmin() { + return isAdmin; + } + public void setIsAdmin(String isAdmin) { + this.isAdmin = isAdmin; + } + + public Team getTeam() { + return team; + } + public void setTeam(Team team) { + this.team = team; + } + + public String getCouleur() { + return couleur; + } + + public void setCouleur(String couleur) { + this.couleur = couleur; + } + + public String getSmiley() { + return smiley; + } + + public void setSmiley(String smiley) { + this.smiley = smiley; + } + + @Override + public String toString() { + return "Membre{" + + "id=" + id + + ", nom='" + nom + '\'' + + ", prenom='" + prenom + '\'' + + ", dateNaissance=" + dateNaissance + + ", email='" + email + '\'' + + ", password='" + password + '\'' + + ", isAdmin='" + isAdmin + '\'' + + ", couleur='" + couleur + '\'' + + ", smiley='" + smiley + '\'' + + /*", team=" + team +*/ + '}'; + } } + diff --git a/src/main/java/fr/organizee/model/Menu.java b/src/main/java/fr/organizee/model/Menu.java new file mode 100644 index 0000000..0444921 --- /dev/null +++ b/src/main/java/fr/organizee/model/Menu.java @@ -0,0 +1,58 @@ +package fr.organizee.model; + +import javax.persistence.*; +import java.time.LocalDate; + +@Entity +public class Menu { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String libelle; + private LocalDate dateMenu; + @ManyToOne + private Team team; + @ManyToOne + private Membre membre; + + public Menu() { + } + + public Menu(String libelle, LocalDate dateMenu) { + this.libelle = libelle; + this.dateMenu = dateMenu; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getLibelle() { + return libelle; + } + + public void setLibelle(String libelle) { + this.libelle = libelle; + } + + public LocalDate getDateMenu() { + return dateMenu; + } + + public void setDateMenu(LocalDate dateMenu) { + this.dateMenu = dateMenu; + } + + @Override + public String toString() { + return "Menu{" + + "id=" + id + + ", libelle='" + libelle + '\'' + + ", dateMenu=" + dateMenu + + '}'; + } +} diff --git a/src/main/java/fr/organizee/model/Tache.java b/src/main/java/fr/organizee/model/Tache.java new file mode 100644 index 0000000..28dd8b1 --- /dev/null +++ b/src/main/java/fr/organizee/model/Tache.java @@ -0,0 +1,56 @@ +package fr.organizee.model; + +import javax.persistence.*; + +@Entity +public class Tache { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String texte; + private boolean etat; + @ManyToOne + @JoinColumn(name = "todolist_id") + private TodoList todolist; + + public Tache(String texte, boolean etat) { + this.texte = texte; + this.etat = etat; + } + + public Tache() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTexte() { + return texte; + } + + public void setTexte(String texte) { + this.texte = texte; + } + + public boolean isEtat() { + return etat; + } + + public void setEtat(boolean etat) { + this.etat = etat; + } + + @Override + public String toString() { + return "Tache{" + + "id=" + id + + ", texte='" + texte + '\'' + + ", etat=" + etat + + '}'; + } +} diff --git a/src/main/java/fr/organizee/model/Team.java b/src/main/java/fr/organizee/model/Team.java index ac4546f..ce562e2 100644 --- a/src/main/java/fr/organizee/model/Team.java +++ b/src/main/java/fr/organizee/model/Team.java @@ -10,6 +10,51 @@ public class Team { @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String nom; + @OneToMany(mappedBy = "team", cascade = CascadeType.ALL, orphanRemoval = true) + //@OneToMany + private List membres = new ArrayList<>(); @OneToMany - private List membre = new ArrayList<>(); + @JoinTable(name = "repertoire") + private List contacts = new ArrayList<>(); + @OneToMany + @JoinTable(name = "team_todolist") + private List todolists = new ArrayList<>(); + @OneToMany + @JoinTable(name="team_menu") + private List menus = new ArrayList<>(); + + public Team() { + super(); + } + + public Team(int id, String nom, List membre) { + super(); + this.id = id; + this.nom = nom; + this.membres = membre; + } + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getNom() { + return nom; + } + public void setNom(String nom) { + this.nom = nom; + } + public List getMembre() { + return membres; + } + public void setMembre(List membre) { + this.membres = membre; + } + + @Override + public String toString() { + return "Team [id=" + id + ", nom=" + nom + ", membre=" + membres + "]"; + } } diff --git a/src/main/java/fr/organizee/model/TodoList.java b/src/main/java/fr/organizee/model/TodoList.java new file mode 100644 index 0000000..c86b70c --- /dev/null +++ b/src/main/java/fr/organizee/model/TodoList.java @@ -0,0 +1,46 @@ +package fr.organizee.model; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +public class TodoList { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private int id; + private String nom; + @OneToMany(mappedBy = "todolist") + private List taches = new ArrayList<>(); + + public TodoList() { + } + + public TodoList(String nom) { + this.nom = nom; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getNom() { + return nom; + } + + public void setNom(String nom) { + this.nom = nom; + } + + @Override + public String toString() { + return "TodoList{" + + "id=" + id + + ", nom='" + nom + '\'' + + '}'; + } +} diff --git a/src/main/java/fr/organizee/repository/ContactRepository.java b/src/main/java/fr/organizee/repository/ContactRepository.java new file mode 100644 index 0000000..b670634 --- /dev/null +++ b/src/main/java/fr/organizee/repository/ContactRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface ContactRepository { +} diff --git a/src/main/java/fr/organizee/repository/MembreRepository.java b/src/main/java/fr/organizee/repository/MembreRepository.java new file mode 100644 index 0000000..61ec145 --- /dev/null +++ b/src/main/java/fr/organizee/repository/MembreRepository.java @@ -0,0 +1,10 @@ +package fr.organizee.repository; + +import fr.organizee.model.Membre; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface MembreRepository extends JpaRepository { + +} diff --git a/src/main/java/fr/organizee/repository/MenuRepository.java b/src/main/java/fr/organizee/repository/MenuRepository.java new file mode 100644 index 0000000..b9bb652 --- /dev/null +++ b/src/main/java/fr/organizee/repository/MenuRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface MenuRepository { +} diff --git a/src/main/java/fr/organizee/repository/TacheRepository.java b/src/main/java/fr/organizee/repository/TacheRepository.java new file mode 100644 index 0000000..17c22b8 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TacheRepository.java @@ -0,0 +1,4 @@ +package fr.organizee.repository; + +public interface TacheRepository { +} diff --git a/src/main/java/fr/organizee/repository/TeamRepository.java b/src/main/java/fr/organizee/repository/TeamRepository.java new file mode 100644 index 0000000..d0b5a00 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TeamRepository.java @@ -0,0 +1,9 @@ +package fr.organizee.repository; + +import fr.organizee.model.Team; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface TeamRepository extends JpaRepository { +} diff --git a/src/main/java/fr/organizee/repository/TodoListRepository.java b/src/main/java/fr/organizee/repository/TodoListRepository.java new file mode 100644 index 0000000..32a2e63 --- /dev/null +++ b/src/main/java/fr/organizee/repository/TodoListRepository.java @@ -0,0 +1,9 @@ +package fr.organizee.repository; + +import fr.organizee.model.TodoList; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface TodoListRepository extends JpaRepository { +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0e709cc..b9be578 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,23 +1,20 @@ -# =============================== # base de données MySQL -# =============================== spring.datasource.url=jdbc:mysql://192.168.1.16:3306/jpa?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC spring.datasource.username= spring.datasource.password= spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # log -logging.level.root=INFO +#logging.level.root=INFO logging.file=d:/data/log-hibernate-jpa.log logging.level.org.springframework.jdbc.core.JdbcTemplate=debug # =============================== # JPA / HIBERNATE # =============================== spring.jpa.show-sql=true -## spring.jpa.hibernate.ddl-auto=update +#spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect # =============================== # Permet d'exécuter le data.sql # =============================== -## spring.datasource.initialization-mode=always - +#spring.datasource.initialization-mode=always diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000..1461cab --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,223 @@ + +-- Export de la structure de la table jpa. team +CREATE TABLE IF NOT EXISTS `team` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.team : ~0 rows (environ) +/*!40000 ALTER TABLE `team` DISABLE KEYS */; +INSERT INTO `team` (`id`, `nom`) VALUES + (1, 'Team JAVA'), + (2, 'Team Angular'), + (3, 'Team PHP'), + (4, 'Team Bancal'); +/*!40000 ALTER TABLE `team` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. membre +CREATE TABLE IF NOT EXISTS `membre` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `couleur` varchar(255) DEFAULT NULL, + `date_naissance` date DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `is_admin` varchar(255) DEFAULT NULL, + `nom` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `prenom` varchar(255) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FKll5mmgkw1h2kmxnuo4885x2fn` (`team_id`), + CONSTRAINT `FKll5mmgkw1h2kmxnuo4885x2fn` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.membre : ~0 rows (environ) +/*!40000 ALTER TABLE `membre` DISABLE KEYS */; +INSERT INTO `membre` (`id`, `couleur`, `date_naissance`, `email`, `is_admin`, `nom`, `password`, `prenom`, `team_id`) VALUES + (1, '#fcba03', '2021-12-13', 'hedi@simplon.com', '0', 'SKYWALKER', 'toto', 'Hédi', 1), + (2, '#8df505', '2021-07-03', 'aline@simplon.com', '0', 'FETT', 'tata', 'Aline', 1), + (3, '#091ced', '2021-01-20', 'isabelle@simplon.com', '0', 'SOLO', 'titi', 'Isabelle', 2), + (4, '#ed09de', '2021-06-29', 'blandine@simplon.com', '0', 'VADER', 'tutu', 'Blandine', 3); +/*!40000 ALTER TABLE `membre` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. team_membres +CREATE TABLE IF NOT EXISTS `team_membres` ( + `team_id` int(11) NOT NULL, + `membres_id` int(11) NOT NULL, + UNIQUE KEY `UK_9e71olu3b26ah1kdrljr5i004` (`membres_id`), + KEY `FK83yf7h5v4bhum1i9bsj8io105` (`team_id`), + CONSTRAINT `FK7w6e9srma4vxmthpdvo9130qp` FOREIGN KEY (`membres_id`) REFERENCES `membre` (`id`), + CONSTRAINT `FK83yf7h5v4bhum1i9bsj8io105` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.team_membres : ~0 rows (environ) +/*!40000 ALTER TABLE `team_membres` DISABLE KEYS */; +INSERT INTO `team_membres` (`team_id`, `membres_id`) VALUES + (1, 1), + (1, 2), + (2, 3), + (3, 4); +/*!40000 ALTER TABLE `team_membres` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. todo_list +CREATE TABLE IF NOT EXISTS `todo_list` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.todo_list : ~0 rows (environ) +/*!40000 ALTER TABLE `todo_list` DISABLE KEYS */; +INSERT INTO `todo_list` (`id`, `nom`) VALUES + (1, 'Pour Blandine'), + (2, 'Corvées'), + (3, 'Noel'); +/*!40000 ALTER TABLE `todo_list` ENABLE KEYS */; + +-- Export de la structure de la table jpa. tache +CREATE TABLE IF NOT EXISTS `tache` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `etat` bit(1) NOT NULL, + `texte` varchar(255) DEFAULT NULL, + `todolist_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK50q0ja9qvoud7ujsudc9jj9yk` (`todolist_id`), + CONSTRAINT `FK50q0ja9qvoud7ujsudc9jj9yk` FOREIGN KEY (`todolist_id`) REFERENCES `todo_list` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.tache : ~0 rows (environ) +/*!40000 ALTER TABLE `tache` DISABLE KEYS */; +INSERT INTO `tache` (`id`, `etat`, `texte`, `todolist_id`) VALUES + (1, b'0', 'Apprendre le PHP', 1), + (2, b'0', 'Revoir CRUD', 1), + (3, b'0', 'Acheter des guirlandes', 3), + (4, b'0', 'Acheter un sapin', 3), + (5, b'0', 'Trouver un repas', 3); +/*!40000 ALTER TABLE `tache` ENABLE KEYS */; + +-- Export de la structure de la table jpa. team_todolist +CREATE TABLE IF NOT EXISTS `team_todolist` ( + `team_id` int(11) NOT NULL, + `todolists_id` int(11) NOT NULL, + UNIQUE KEY `UK_fjwjvprqqeeugglduq8rdhsyw` (`todolists_id`), + KEY `FK7jh4kgpji05rll7nagp4dsago` (`team_id`), + CONSTRAINT `FK4ntj6ub8hheh7f4w79qy3ql40` FOREIGN KEY (`todolists_id`) REFERENCES `todo_list` (`id`), + CONSTRAINT `FK7jh4kgpji05rll7nagp4dsago` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.team_todolist : ~0 rows (environ) +/*!40000 ALTER TABLE `team_todolist` DISABLE KEYS */; +INSERT INTO `team_todolist` (`team_id`, `todolists_id`) VALUES + (2, 2), + (2, 3), + (3, 1); +/*!40000 ALTER TABLE `team_todolist` ENABLE KEYS */; + +-- Export de la structure de la table jpa. smiley +CREATE TABLE IF NOT EXISTS `smiley` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `smiley_url` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.smiley : ~0 rows (environ) +/*!40000 ALTER TABLE `smiley` DISABLE KEYS */; +INSERT INTO `smiley` (`id`, `smiley_url`) VALUES + (1, 'https://assets.wprock.fr/emoji/joypixels/512/1f600.png'), + (2, 'https://assets.wprock.fr/emoji/joypixels/512/1f618.png'), + (3, 'https://assets.wprock.fr/emoji/joypixels/512/1f92e.png'), + (4, 'https://assets.wprock.fr/emoji/joypixels/512/1f92c.png'); +/*!40000 ALTER TABLE `smiley` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. smiley_membres +CREATE TABLE IF NOT EXISTS `smiley_membres` ( + `smiley_id` int(11) NOT NULL, + `membres_id` int(11) NOT NULL, + UNIQUE KEY `UK_haqfbvq4lbo8rb77uew2yvwuw` (`membres_id`), + KEY `FK9msxvne1uolrrrg8aq9p53sc4` (`smiley_id`), + CONSTRAINT `FK4fj42p25xaldnw9koqktnhil2` FOREIGN KEY (`membres_id`) REFERENCES `membre` (`id`), + CONSTRAINT `FK9msxvne1uolrrrg8aq9p53sc4` FOREIGN KEY (`smiley_id`) REFERENCES `smiley` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.smiley_membres : ~0 rows (environ) +/*!40000 ALTER TABLE `smiley_membres` DISABLE KEYS */; +INSERT INTO `smiley_membres` (`smiley_id`, `membres_id`) VALUES + (1, 3), + (3, 2), + (4, 1); +/*!40000 ALTER TABLE `smiley_membres` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. menu +CREATE TABLE IF NOT EXISTS `menu` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `date_menu` date DEFAULT NULL, + `libelle` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.menu : ~0 rows (environ) +/*!40000 ALTER TABLE `menu` DISABLE KEYS */; +/*!40000 ALTER TABLE `menu` ENABLE KEYS */; + + +-- Export de la structure de la table jpa. contact +CREATE TABLE IF NOT EXISTS `contact` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `adresse` varchar(255) DEFAULT NULL, + `date_naissance` date DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `nom` varchar(255) DEFAULT NULL, + `prenom` varchar(255) DEFAULT NULL, + `telephone` varchar(255) DEFAULT NULL, + `team_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK7gyd9s84tx9eeuigeu3uv984x` (`team_id`), + CONSTRAINT `FK7gyd9s84tx9eeuigeu3uv984x` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.contact : ~0 rows (environ) +/*!40000 ALTER TABLE `contact` DISABLE KEYS */; +INSERT INTO `contact` (`id`, `adresse`, `date_naissance`, `email`, `nom`, `prenom`, `telephone`, `team_id`) VALUES + (1, '7554 Messerschmidt Center', '2021-01-24', 'oogleasane0@cargocollective.com', 'Ophelia', 'O\'Gleasane', '913-198-6499', 1), + (2, '534 Jay Way', '2021-03-26', 'fmowett1@ocn.ne.jp', 'Fiann', 'Mowett', '248-224-7233', 1), + (3, '077 Buell Place', '2021-06-24', 'vlewknor2@spotify.com', 'Vladamir', 'Lewknor', '922-822-3626', 1), + (4, '6226 Esker Street', '2021-04-13', 'jbarmadier3@opensource.org', 'Jervis', 'Barmadier', '838-581-8112', 1), + (5, '28531 Luster Circle', '2021-06-15', 'tmee4@ameblo.jp', 'Tuesday', 'Mee', '761-975-7324', 2), + (6, '96 Hallows Avenue', '2021-08-13', 'tcolvine5@elegantthemes.com', 'Toni', 'Colvine', '348-778-7679', 2), + (7, '6401 Jay Crossing', '2021-01-14', 'rrielly6@netlog.com', 'Riane', 'Rielly', '740-571-0835', 2), + (8, '3273 Cascade Pass', '2021-03-22', 'jlauder7@rambler.ru', 'Juieta', 'Lauder', '928-408-6855', 2), + (9, '1170 Burning Wood Road', '2021-05-31', 'tbolver8@google.ca', 'Thibaut', 'Bolver', '681-860-8291', 3), + (10, '1 Westridge Road', '2021-03-11', 'emebs9@uol.com.br', 'Evered', 'Mebs', '898-483-6075', 3); +/*!40000 ALTER TABLE `contact` ENABLE KEYS */; + + + +-- Export de la structure de la table jpa. repertoire +CREATE TABLE IF NOT EXISTS `repertoire` ( + `team_id` int(11) NOT NULL, + `contacts_id` int(11) NOT NULL, + UNIQUE KEY `UK_g91q6p6ssjxdhcallbd9yfary` (`contacts_id`), + KEY `FK7u57nrpbtl5yhuh3nyx0ccy88` (`team_id`), + CONSTRAINT `FK7u57nrpbtl5yhuh3nyx0ccy88` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`), + CONSTRAINT `FKe3fy0q6urmw03kn29mj7h7vf5` FOREIGN KEY (`contacts_id`) REFERENCES `contact` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Export de données de la table jpa.repertoire : ~0 rows (environ) +/*!40000 ALTER TABLE `repertoire` DISABLE KEYS */; +INSERT INTO `repertoire` (`team_id`, `contacts_id`) VALUES + (1, 1), + (1, 2), + (1, 3), + (1, 4), + (2, 5), + (2, 6), + (2, 7), + (2, 8), + (3, 9), + (3, 10); +/*!40000 ALTER TABLE `repertoire` ENABLE KEYS */; \ No newline at end of file