From b3c5c08a9d875e36f3c2480353b8fde9e5bc82bc Mon Sep 17 00:00:00 2001 From: Hedi Date: Tue, 14 Dec 2021 16:13:36 +0100 Subject: [PATCH] moins les properties --- .gitignore | 1 + .../repository/SmileyRepository.java | 4 - src/main/resources/application.properties | 8 +- src/main/resources/data.sql | 231 +++++++++++++++--- 4 files changed, 197 insertions(+), 47 deletions(-) delete mode 100644 src/main/java/fr/organizee/repository/SmileyRepository.java diff --git a/.gitignore b/.gitignore index 1a03347..2ea2eec 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ build/ ### VS Code ### .vscode/ /.idea/ +/src/main/resources/ diff --git a/src/main/java/fr/organizee/repository/SmileyRepository.java b/src/main/java/fr/organizee/repository/SmileyRepository.java deleted file mode 100644 index f4d2d5d..0000000 --- a/src/main/java/fr/organizee/repository/SmileyRepository.java +++ /dev/null @@ -1,4 +0,0 @@ -package fr.organizee.repository; - -public interface SmileyRepository { -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8dc34fb..65eea51 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,9 +1,9 @@ # =============================== -# base de données MySQL +# base de données MySQL toto # =============================== spring.datasource.url=jdbc:mysql://192.168.1.16:3306/jpa?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC -spring.datasource.username=desktop -spring.datasource.password=Cosmoc4t$77 +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # log #logging.level.root=INFO @@ -13,7 +13,7 @@ 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 # =============================== diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index f5f354a..1461cab 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -1,39 +1,214 @@ + +-- 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 */; -INSERT INTO `membre` (`id`, `couleur`, `date_naissance`, `email`, `is_admin`, `nom`, `password`, `prenom`) VALUES - (1, '#fcba03', '2021-12-13', 'hedi@simplon.com', '0', 'SKYWALKER', 'toto', 'Hédi'), - (2, '#8df505', '2021-07-03', 'aline@simplon.com', '0', 'FETT', 'tata', 'Aline'), - (3, '#091ced', '2021-01-20', 'isabelle@simplon.com', '0', 'SOLO', 'titi', 'Isabelle'), - (4, '#ed09de', '2021-06-29', 'blandine@simplon.com', '0', 'VADER', 'tutu', 'Blandine'); +-- 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 */; -INSERT INTO `contact` (`id`, `adresse`, `date_naissance`, `email`, `nom`, `prenom`, `telephone`) VALUES - (1, '7554 Messerschmidt Center', '2021-01-24', 'oogleasane0@cargocollective.com', 'Ophelia', 'O\'Gleasane', '913-198-6499'), - (2, '534 Jay Way', '2021-03-26', 'fmowett1@ocn.ne.jp', 'Fiann', 'Mowett', '248-224-7233'), - (3, '077 Buell Place', '2021-06-24', 'vlewknor2@spotify.com', 'Vladamir', 'Lewknor', '922-822-3626'), - (4, '6226 Esker Street', '2021-04-13', 'jbarmadier3@opensource.org', 'Jervis', 'Barmadier', '838-581-8112'), - (5, '28531 Luster Circle', '2021-06-15', 'tmee4@ameblo.jp', 'Tuesday', 'Mee', '761-975-7324'), - (6, '96 Hallows Avenue', '2021-08-13', 'tcolvine5@elegantthemes.com', 'Toni', 'Colvine', '348-778-7679'), - (7, '6401 Jay Crossing', '2021-01-14', 'rrielly6@netlog.com', 'Riane', 'Rielly', '740-571-0835'), - (8, '3273 Cascade Pass', '2021-03-22', 'jlauder7@rambler.ru', 'Juieta', 'Lauder', '928-408-6855'), - (9, '1170 Burning Wood Road', '2021-05-31', 'tbolver8@google.ca', 'Thibaut', 'Bolver', '681-860-8291'), - (10, '1 Westridge Road', '2021-03-11', 'emebs9@uol.com.br', 'Evered', 'Mebs', '898-483-6075'); +-- 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), @@ -45,26 +220,4 @@ INSERT INTO `repertoire` (`team_id`, `contacts_id`) VALUES (2, 8), (3, 9), (3, 10); - -INSERT INTO `smiley_membres` (`smiley_id`, `membres_id`) VALUES - (1, 3), - (3, 2), - (4, 1); - -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); - -INSERT INTO `team_membres` (`team_id`, `membres_id`) VALUES - (1, 1), - (1, 2), - (2, 3), - (3, 4); - -INSERT INTO `team_todolist` (`team_id`, `todolists_id`) VALUES - (2, 2), - (2, 3), - (3, 1); \ No newline at end of file +/*!40000 ALTER TABLE `repertoire` ENABLE KEYS */; \ No newline at end of file