Files
sql/README.md

30 lines
780 B
Markdown
Raw Normal View History

2025-08-28 10:38:03 +02:00
### Construire l'image
2025-08-26 07:55:29 +02:00
2025-08-28 10:38:03 +02:00
```shell
2025-09-03 09:32:47 +02:00
docker build -t iut/pgsql:2025-09 .
2025-08-26 07:55:29 +02:00
```
2025-08-28 10:38:03 +02:00
## Données
2025-08-26 07:55:29 +02:00
2025-09-01 07:56:13 +02:00
### Conventions de nommage
Le nom des tables est au singulier et en minuscule
2025-08-28 10:38:03 +02:00
### Schéma
2025-08-26 07:55:29 +02:00
2025-09-01 07:56:13 +02:00
table |colonnes
--- |---
adherent | id, nom, prenom, genre, naissance, codepostal
famille | code, famille, code_parent
article | code, article, famille_code, factpoids, prix
ticket | id, date_ticket, adherent_id, mode_rglt
ligne | id, ticket_id, article_code, prix_unitaire, quantite
2025-08-29 22:12:55 +02:00
### Export
```shell
psql -h 127.0.0.1 -d sql -U sql -c "\copy (select * from ligne order by id) to './ligne.csv' with csv header"
2025-09-06 06:42:27 +02:00
psql -h 127.0.0.1 -d sql -U sql -c "\copy (select id, source, target, cost, reverse_cost, ST_AsText(geom) from route order by id) to './route.csv' with csv header"
2025-08-29 22:12:55 +02:00
```