Merge pull request #2 from HediMjid/hedii

full push
This commit is contained in:
HediMjid 2021-12-14 17:16:10 +01:00 committed by GitHub
commit 80723c1179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 772 additions and 27 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ build/
### VS Code ### ### VS Code ###
.vscode/ .vscode/
/.idea/
/src/main/resources/

1
.idea/compiler.xml generated
View File

@ -6,7 +6,6 @@
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="organizee" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
</component> </component>

4
.idea/misc.xml generated
View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<<<<<<< HEAD
<component name="ProjectRootManager">
=======
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
<option name="originalFiles"> <option name="originalFiles">
@ -12,7 +9,6 @@
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
>>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

8
.idea/modules.xml generated
View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Organizee.iml" filepath="$PROJECT_DIR$/.idea/Organizee.iml" />
</modules>
</component>
</project>

4
.idea/vcs.xml generated
View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<<<<<<< HEAD
<mapping directory="" vcs="Git" />
=======
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
>>>>>>> 6aab769d68a38febc5aab3691296993cf7462d11
</component> </component>
</project> </project>

View File

@ -51,4 +51,4 @@
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -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("<h1>Affichages des membres</h1>");
sb.append("<ul><li><a href='http://localhost:8080/membres/all'>Liste des <strong>membres</strong></a></li>");
return sb.toString();
}
@GetMapping(value = "/membres/all")
public ResponseEntity<?> getAll(){
List<Membre> 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<Team> 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> 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<Team> 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);
}
}

View File

@ -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 +
'}';
}
}

View File

@ -3,6 +3,7 @@ package fr.organizee.model;
import javax.persistence.*; import javax.persistence.*;
import java.time.LocalDate; import java.time.LocalDate;
@Entity @Entity
public class Membre { public class Membre {
@Id @Id
@ -14,8 +15,107 @@ public class Membre {
private String email; private String email;
private String password; private String password;
private String isAdmin; private String isAdmin;
private String testGit; private String couleur;
@ManyToOne(fetch= FetchType.EAGER) private String smiley;
@ManyToOne
@JoinColumn(name="TEAM_ID") @JoinColumn(name="TEAM_ID")
private Team team; 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 +*/
'}';
}
} }

View File

@ -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 +
'}';
}
}

View File

@ -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 +
'}';
}
}

View File

@ -10,6 +10,51 @@ public class Team {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private int id; private int id;
private String nom; private String nom;
@OneToMany(mappedBy = "team", cascade = CascadeType.ALL, orphanRemoval = true)
//@OneToMany
private List<Membre> membres = new ArrayList<>();
@OneToMany @OneToMany
private List<Membre> membre = new ArrayList<>(); @JoinTable(name = "repertoire")
private List<Contact> contacts = new ArrayList<>();
@OneToMany
@JoinTable(name = "team_todolist")
private List<TodoList> todolists = new ArrayList<>();
@OneToMany
@JoinTable(name="team_menu")
private List<Menu> menus = new ArrayList<>();
public Team() {
super();
}
public Team(int id, String nom, List<Membre> 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<Membre> getMembre() {
return membres;
}
public void setMembre(List<Membre> membre) {
this.membres = membre;
}
@Override
public String toString() {
return "Team [id=" + id + ", nom=" + nom + ", membre=" + membres + "]";
}
} }

View File

@ -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<Tache> 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 + '\'' +
'}';
}
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface ContactRepository {
}

View File

@ -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<Membre, Integer> {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface MenuRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface TacheRepository {
}

View File

@ -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<Team, Integer> {
}

View File

@ -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<TodoList, Integer> {
}

View File

@ -1,23 +1,20 @@
# ===============================
# base de données MySQL # 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.url=jdbc:mysql://192.168.1.16:3306/jpa?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC
spring.datasource.username= spring.datasource.username=
spring.datasource.password= spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# log # log
logging.level.root=INFO #logging.level.root=INFO
logging.file=d:/data/log-hibernate-jpa.log logging.file=d:/data/log-hibernate-jpa.log
logging.level.org.springframework.jdbc.core.JdbcTemplate=debug logging.level.org.springframework.jdbc.core.JdbcTemplate=debug
# =============================== # ===============================
# JPA / HIBERNATE # JPA / HIBERNATE
# =============================== # ===============================
spring.jpa.show-sql=true 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.hibernate.ddl-auto=create-drop
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
# =============================== # ===============================
# Permet d'exécuter le data.sql # Permet d'exécuter le data.sql
# =============================== # ===============================
## spring.datasource.initialization-mode=always #spring.datasource.initialization-mode=always

223
src/main/resources/data.sql Normal file
View File

@ -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 */;