Skip to content

Commit

Permalink
màj bdd
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Béthus committed Jun 18, 2024
1 parent 37d3c65 commit 397fe17
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 41 deletions.
20 changes: 10 additions & 10 deletions demo/module-parsing/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: postgres
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
properties:
hibernate:
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:55666/postgres
username: postgres
password: postgres
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
properties:
hibernate:
show_sql: false
35 changes: 18 additions & 17 deletions demo/module-reporting/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
version: '3.9'

services:
postgres:
image: postgres:16.2
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./src/test/resources/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres

volumes:
postgres_data:
version: '3.9'

services:
postgres:
image: postgres:16.2
container_name: soldat_ram_bdd
ports:
- "55666:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./src/test/resources/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres

volumes:
postgres_data:
2 changes: 1 addition & 1 deletion demo/module-reporting/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/postgres
url: jdbc:postgresql://localhost:55666/postgres
username: postgres
password: postgres
jpa:
Expand Down
6 changes: 3 additions & 3 deletions demo/module-reporting/src/test/resources/generate_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ generate_random_text() {

# Définition des valeurs possibles pour les champs
codes_postaux=('33300' '24002' '12003' '45004' '75005' '65006' '75007' '75008' '75009' '75010')
pays=('France' 'Germany' 'United Kingdom' 'Italy' 'Spain' 'Portugal' 'Netherlands' 'Belgium' 'Switzerland' 'Austria')
listePays=('France' 'Germany' 'United Kingdom' 'Italy' 'Spain' 'Portugal' 'Netherlands' 'Belgium' 'Switzerland' 'Austria')
noms_destinataires=('Forrest Gump' 'Woody' 'Captain John Miller' 'Chuck Noland' 'Walt Disney' 'Paul Edgecomb' 'Joe Fox' 'Ben Bradlee' 'Jim Lovell' 'Charlie Wilson' 'Josh Baskin' 'James Donovan' 'Andrew Beckett' 'Larry Crowne' 'David S. Pumpkins' 'Michael Sullivan' 'Richard Phillips' 'Joe Banks' 'James Mattingly' 'Carl Hanratty')
noms_expediteurs=('Forrest Gump' 'Woody' 'Captain John Miller' 'Chuck Noland' 'Walt Disney' 'Paul Edgecomb' 'Joe Fox' 'Ben Bradlee' 'Jim Lovell' 'Charlie Wilson' 'Josh Baskin' 'James Donovan' 'Andrew Beckett' 'Larry Crowne' 'David S. Pumpkins' 'Michael Sullivan' 'Richard Phillips' 'Joe Banks' 'James Mattingly' 'Carl Hanratty')

# Génération des insertions SQL
for (( i=1; i<=4000000; i++ )); do
code_postal="${codes_postaux[$RANDOM % ${#codes_postaux[@]}]}"
pays="${pays[$RANDOM % ${#pays[@]}]}"
pays="${listePays[$RANDOM % ${#listePays[@]}]}"
destinataire="${noms_destinataires[$RANDOM % ${#noms_destinataires[@]}]}"
expediteur="${noms_expediteurs[$RANDOM % ${#noms_expediteurs[@]}]}"
contenu="Contenu du courrier numéro $i"

echo "INSERT INTO courrier (code_postal, ville, pays, destinataire, expediteur, contenu) VALUES ('$code_postal', 'Philadelphie', '$pays', '$destinataire', '$expediteur', '$contenu');"
echo "INSERT INTO courrier (code_postal, ville, pays, destinataire, expediteur, contenu) VALUES ('$code_postal', 'Philadelphie', '$pays', '$destinataire', '$expediteur', '$contenu');" >> data.sql
done
20 changes: 10 additions & 10 deletions demo/module-tri-courriers/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: postgres
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
properties:
hibernate:
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:55666/postgres
username: postgres
password: postgres
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
properties:
hibernate:
show_sql: true

0 comments on commit 397fe17

Please sign in to comment.