This commit is contained in:
2025-09-01 07:56:13 +02:00
parent 41b613f451
commit 68144c3918
10 changed files with 257 additions and 93 deletions

View File

@@ -1,5 +1,28 @@
FROM debian:trixie AS build-essential
RUN set -eux; \
apt-get update; \
apt-get upgrade -y
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
checkinstall \
;
FROM build-essential AS build-pgdev
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
postgresql-server-dev-17 \
;
# Étape 1 : builder temporaire pour compiler pgTAP
FROM debian:trixie AS builder
FROM debian:trixie AS pgTAP
# Installer les outils nécessaires pour compiler pgTAP
RUN apt-get update && \
@@ -16,7 +39,55 @@ RUN git clone --depth 1 https://github.com/theory/pgtap.git /usr/src/pgtap && \
make && \
make install DESTDIR=/pgtap-dist
# Étape 2 : image finale PostgreSQL propre
# =============================================================================
# pgRouting
FROM build-pgdev AS pgrouting
ARG pgrouting_release=3.8.0
ADD "https://github.com/pgRouting/pgrouting/releases/download/v${pgrouting_release}/pgrouting-${pgrouting_release}.tar.gz" \
/tmp/pgrouting.tar.gz
RUN set -eux; \
tar -xvf /tmp/pgrouting.tar.gz -C /tmp; \
rm -rf /tmp/pgrouting.tar.gz;
# Installer les dépendances de compilation
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libboost-all-dev \
;
WORKDIR /tmp/pgrouting-${pgrouting_release}/build
RUN cmake -DBUILD_HTML=OFF -DBUILD_DOXY=OFF ..
# Create debian package
RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp \
--pkgname=pgrouting --pkgversion=${pgrouting_release} \
--nodoc
# =============================================================================
# pgVector
FROM build-pgdev AS pgvector
ARG pgvector_release=0.6.2
ADD "https://github.com/pgvector/pgvector/archive/refs/tags/v${pgvector_release}.tar.gz" \
/tmp/pgvector.tar.gz
RUN tar -xvf /tmp/pgvector.tar.gz -C /tmp && \
rm -rf /tmp/pgvector.tar.gz
# Build from source
WORKDIR /tmp/pgvector-${pgvector_release}
RUN make -j$(nproc)
# Create debian package
RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp \
--nodoc
# Étape 3 : image finale PostgreSQL propre
FROM postgres:17.6
RUN set -eux; \
@@ -37,4 +108,13 @@ RUN set -eux; \
postgresql-postgis
# Copier uniquement les fichiers installés depuis le builder
COPY --from=builder /pgtap-dist/ /
COPY --from=pgTAP /pgtap-dist/ /
COPY --from=pgrouting /tmp/*.deb /tmp
COPY --from=pgvector /tmp/*.deb /tmp
RUN set -eux; \
apt-get install \
/tmp/*.deb \
-y; \
rm /tmp/*.deb;

View File

@@ -6,15 +6,19 @@ docker build -t iut/pgsql:2025-08 .
## Données
### Conventions de nommage
Le nom des tables est au singulier et en minuscule
### Schéma
```
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
```
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
### Export

View File

@@ -1,6 +1,6 @@
services:
database:
image: iut/pgsql:2025-08
image: iut/pgsql:2025-09
environment:
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=fr-FR"
POSTGRES_DB: ${COMPOSE_PROJECT_NAME}

View File

@@ -272,7 +272,7 @@ CONCOM,Concombre Noa Jardins,02CONC,t,3,3.5,0
CONCOMSCOT,Concombre long FR,02CONC,f,2,1.9,0
CONFITUREC,Confiture en pot 370g,12,f,1,5,0
CONSOUDE,Consoude officinale Bio Plant,05AROM,f,2,2.3,0
COOKIEEPEAUTRE300,Cookies Epeautre 300 gr,12PROVINCE,f,1,6.7,0
COOKIEEPEAUTRE300,Cookies Epeautre 300 gr,04PA,f,1,6.7,0
CORI,Coriandre Bio Plant,05AROM,f,2,2.3,0
CORIAND,Coriande bouquet,02AROM,f,1,1.4,0
CORIANDRADESCOT,Coriandrade 100g,04MOUT,f,1,4.3,0
@@ -509,10 +509,10 @@ LENTBELUGA,lentille beluga 500 g,04LENT,f,1,3.45,2
LENTIL,Lentillons 500 g,04LENT,f,2,3.15,2
LENTILLEBELUGAKG,Lentilles Beluga Kg,04CEREALE,t,3,4.5,0
LENTILLECORAIL,Lentille Corail Vrac,04CEREALE,t,3,4.5,2
LENTILVERT,Lentilles vertes 1kg,12PROVINCE,f,1,5.5,0
LENTILVERT,Lentilles vertes 1kg,04LENT,f,1,5.5,0
LENTILVERTE,Lentilles vertes 500 gr,04LENT,f,1,3.3,2
LENTKG,Lentilles Vrac,12PROVINCE,t,3,4.2,0
LENTVERT5,Lentilles vertes 500g,12PROVINCE,f,1,3,0
LENTKG,Lentilles Vrac,04LENT,t,3,4.2,0
LENTVERT5,Lentilles vertes 500g,04LENT,f,1,3,0
LEVURE,Saf-Levure Boite 125g,04MOUT,f,1,1.7,2
LIN,Lin brun kg,04CEREALE,t,3,3.8,2
LITCHI,Litchi Madagascar,03EXOTIQ,t,3,12.45,2
@@ -539,7 +539,7 @@ MAQUEREAUSM,Maquereaux moutarde 113g,04POIS,f,1,3.4,2
MAQVINBLANC,Maquereaux au vin blanc,04POIS,f,1,3.1,2
MARACU,Maracuja Ouganda,03CHERI,t,3,19.5,2
MARJO,Marjolaine Plant,05AROM,f,2,2.3,0
MARJOL,Marjolaine Bio Plant,05AROM2,f,2,2.3,0
MARJOL,Marjolaine Bio Plant,05AROMCH,f,2,2.3,0
MARRON,Marron d'Ardèche,03FS,t,3,9.05,2
MARRONENTIERVAP,Marron entier Cuit Vapeur 200g,03FS,f,1,4.2,2
MARRONPRECUIT,Marron pré-cuit France,03FS,f,2,4,2
@@ -551,7 +551,7 @@ MELANGE,Mélange Fleurs semences,05SEME,f,1,2,0
MELCHAMPI,Mélange champignons,02CHAM,t,3,7,0
MELFRUISEC,Melange pom poir mang bana,03FS,t,3,25,2
MELGATEAU,Melange gateau 30g,12ARTISMON,f,2,2.4,0
MELISSE,Mélisse Bio Plant,05AROM2,f,2,2.3,0
MELISSE,Mélisse Bio Plant,05AROMCH,f,2,2.3,0
MELOGAL,Melon Galia Espagne,03MELON,t,3,2.9,2
MELON,Melon Charentais France,03MELON,t,3,3.5,2
MELONCAN,Melon Cantaloup Italie kg,03MELON,t,3,2.5,2
@@ -561,14 +561,14 @@ MELONPO,Melon Porto France,03MELON,t,3,2.9,2
MELPLT,Melon Bio Plant,05MELON,f,2,2.2,0
MELWOKEPIC,Mélange wok épicé,15TRANSLEG,t,3,14,0
MELWOKNAT,Mélange wok nature,15TRANSLEG,t,3,12,0
MEMA,Menthe marocaine Bio Plant,05AROM2,f,2,2.3,0
MENCH,Menthe chocolat Plant,05AROM2,f,2,2.3,0
MENMA,Menthe Pomme Plant,11MENTHE,f,2,2,0
MEMA,Menthe marocaine Bio Plant,05AROMCH,f,2,2.3,0
MENCH,Menthe chocolat Plant,05AROMCH,f,2,2.3,0
MENMA,Plant Menthe Pomme,11MENTHE,f,2,2,0
MENSPI,Menthe spicata Plant,05AROM,f,2,2,0
MENTHE,Menthe,02AROM,f,2,1.2,0
MENTORA,Menthe orange Bio Plant,05AROM2,f,2,2.3,0
MENTPOM,Menthe pomme Bio Plant,05AROM2,f,2,2.3,0
MEPO,Menthe poivrée Plant,05AROM2,f,2,2.3,0
MENTORA,Menthe orange Bio Plant,05AROMCH,f,2,2.3,0
MENTPOM,Menthe pomme Bio Plant,05AROMCH,f,2,2.3,0
MEPO,Menthe poivrée Plant,05AROMCH,f,2,2.3,0
MERI,Meringue sachet,04PA,f,2,1.2,2
MESCLU,Mesclun de chou asiatique,02SALA,t,3,13,0
MESCLUN,Mesclun,02SALA,t,3,5,0
@@ -668,24 +668,24 @@ ORANWAS,Orange Afrique Sud,03ORANGE,t,3,4.95,2
ORAOVALI,Orange Valancia Italie,03ORANGE,t,3,2,2
ORASALA,Orange à jus kg Espagne,03ORANGE,t,3,2.2,2
ORIG,Origan Plant,05AROM,f,2,2,0
ORIGA,Origan Bio Plant,05AROM2,f,2,2.3,0
ORIGA,Origan Bio Plant,05AROMCH,f,2,2.3,0
ORIGAN,Origan vulgaire Plant,05AROM,f,2,2,0
ORMALTA,Orange maltaise tarocco Italie,03ORANGE,t,3,2.8,2
ORTILLETTE33,Ortillette 33cl,04BOISSONS,f,2,2.6,2
ORTILLETTE75,Ortillette 75cl,04BOISSONS,f,2,4.9,2
OSEILLE,Oseille Bio Plant,05AROM2,f,2,2.3,0
OSEILPOU,Oseille pourpre Bio Plant,05AROM2,f,2,2.3,0
OSEILLE,Oseille Bio Plant,05AROMCH,f,2,2.3,0
OSEILPOU,Oseille pourpre Bio Plant,05AROMCH,f,2,2.3,0
OSTARA,pomme ostara,02POMM,t,3,1.5,0
P4GR05,Pain 4 graines 500 g,04PA,f,2,3.1,2
PAINB,Pain blé moulé 750g,04PA,f,2,2.9,2
PAINBLE,Pain soldé,04PA,f,2,1,2
PAINBLECOMPLET500,Complet Blé 500g,12PROVINCE,f,1,3.5,0
PAINBLEDEMICOM500,Semi-complet Blé 500g,12PROVINCE,f,2,3.3,0
PAINBLEMULTIGR500,Multi-graines 500g,12PROVINCE,f,1,4.5,0
PAINBLENOIX500,Noix 500g,12PROVINCE,f,1,4.8,0
PAINBLERAISIN500,Raisins Pain 500g,12PROVINCE,f,1,4.5,0
PAINBLECOMPLET500,Complet Blé 500g,04PA,f,1,3.5,0
PAINBLEDEMICOM500,Semi-complet Blé 500g,04PA,f,2,3.3,0
PAINBLEMULTIGR500,Multi-graines 500g,04PA,f,1,4.5,0
PAINBLENOIX500,Noix 500g,04PA,f,1,4.8,0
PAINBLERAISIN500,Raisins Pain 500g,04PA,f,1,4.5,0
PAINEP,Pain de vieilles variétés 500g,04PA,f,2,2.9,2
PAINEPEAUTRE500,Epeautre 500g,12PROVINCE,f,1,4.8,0
PAINEPEAUTRE500,Epeautre 500g,04PA,f,1,4.8,0
PAINEPICE,Pain d'épices nature fermier 350g,04PA,f,1,7.9,2
PAINEPICECHOCO,Pain d'épices chocolat orange 350g,04PA,f,1,8.4,2
PAINEPICENAT,Pain d'épice nature,12ARTISMON,f,2,5.6,0
@@ -695,10 +695,10 @@ PAINFLEURSSANSSEL,Pain Fleurs Ss Sel Ss Gluten 150g,04PA,f,1,3,2
PAINMI,Pain de mie 500 g,04PA,f,2,3.6,2
PAINNOIX,Pain aux noix 500g,04PA,f,1,3.1,2
PAINOI,Pain aux graines courge 500g,04PA,f,2,3.1,2
PAINPETEPEAUTRE500,Petit Epeautre 500g,12PROVINCE,f,1,6.2,0
PAINPETEPEAUTRE500,Petit Epeautre 500g,04PA,f,1,6.2,0
PAINS,Salade Pain de sucre kg,02SALA,t,3,3.5,0
PAINSARRASINRIZ400,Sarrasin Riz 400g,12PROVINCE,f,1,4.6,0
PAINSEIGLE500,Seigle 500g,12PROVINCE,f,1,3.9,0
PAINSARRASINRIZ400,Sarrasin Riz 400g,04PA,f,1,4.6,0
PAINSEIGLE500,Seigle 500g,04PA,f,1,3.9,0
PAIRAI,Pain aux raisins 500g,04PA,f,2,3.1,2
PAMAN,Poudre d'amande vrac,03FS,t,3,18.3,2
PANAIS,Panais Jardins,02PANA,t,3,3.3,0
@@ -750,9 +750,9 @@ PECHESBARQUETTE,Barquette de pêches,03PECHE,f,1,2.9,2
PECHJ,Pêche plate france,03PECHE,t,3,7.75,2
PECHJA,Pêche de vigne,03PECHE,t,3,6.7,2
PECPLA,Pêche Sanguine,03PECHE,t,3,7.55,2
PEFR,Persil frisé Bio Plant,05AROM2,f,2,2.3,0
PEFR,Persil frisé Bio Plant,05AROMCH,f,2,2.3,0
PEPE05,Epeautre 500 g,04PA,f,2,3.2,2
PEPL,Persil plat Bio Plant,05AROM2,f,2,2.3,0
PEPL,Persil plat Bio Plant,05AROMCH,f,2,2.3,0
PEPOIS,Petit pois Jardins,02POIS,t,3,8,0
PERSIL,Persil vrac,02AROM,t,3,28,0
PERSILFR,Persil Bouquet,02AROM,f,2,1,2
@@ -766,7 +766,7 @@ PHYSABQ,Physalis Jardins,03CHERI,t,3,11,2
PHYSALIS,Physalis Bio Plant,05PLANT,f,2,2.3,0
PIGNON,Pignons de Pin Espagne,03FS,f,1,17.3,2
PIMENT,Piment Bio Plant,05SOLAN,f,2,1.5,0
PIMPREN,Pimprenelle Bio Plant,05AROM2,f,2,2.3,0
PIMPREN,Pimprenelle Bio Plant,05AROMCH,f,2,2.3,0
PISSEN,Pissenlit,02SALA,t,3,18,0
PISTA,Pistache déc.vrac Italie,03FS,t,3,63,2
PISTA250,Pistache décortiquée 250 grs,03FS,f,2,14.55,2
@@ -896,7 +896,7 @@ RAICHAS,Raisin blanc Chasselas France,03RAISIN,t,3,6.75,2
RAICHRO,Raisin rosé Chasselas France,03RAISIN,t,3,6.7,2
RAICLA,Raisin blanc vittoria italie,03RAISIN,t,3,4.3,2
RAIDANFR,Raisin blanc Danlas France,03RAISIN,t,3,6,2
RAIFO,Raifort Bio Plant,05AROM2,f,2,2.3,0
RAIFO,Raifort Bio Plant,05AROMCH,f,2,2.3,0
RAIITA,raisin exalta sans pépins France,03RAISIN,t,3,6.95,2
RAILAV,Raisin Lavallée Noir,03RAISIN,t,3,6.2,2
RAILIV,Raisin muscat noir,03RAISIN,t,3,7.3,2
@@ -931,12 +931,12 @@ RIZLON,Riz long blanc thai vrac,04CEREALE,t,3,4.5,2
RIZTHAIJASMB,Riz thai jasmin blanc 500g,12ARTISMON,f,2,3.05,0
RIZTHAIJASMC,Riz thai jasmin complet 500g,12ARTISMON,f,2,2.75,0
RIZTRIOCAMARGUE,Riz Trio Camargue Vrac,04CEREALE,t,3,6.7,2
ROMA,Romarin Bio Plant,05AROM2,f,2,2.3,0
ROMA,Romarin Bio Plant,05AROMCH,f,2,2.3,0
ROOIBOS,Rooibos afrique super fruit 80g,12ARTISMON,f,2,6.4,0
ROQU,Roquette poids,02SALA,t,3,6,0
ROQUE,Roquette sauvage Plant,05AROM,f,2,2,0
ROQUEFORT,Roquefort papillon,04FROMAGE,f,2,3.95,2
ROQUEPL,Roquette Bio Plant,05AROM2,f,2,2.3,0
ROQUEPL,Roquette Bio Plant,05AROMCH,f,2,2.3,0
ROQUET,Roquette,02SALA,t,3,12,0
ROULEAUPRINTEMPS,Rouleau de Printemps Kg,15TRANSLEG,t,3,20,0
RUTABA,Rutabaga Jardins,02NARU,t,3,2.6,0
@@ -974,9 +974,9 @@ SARDINECITRON,Sardines à l'huile et citron 220g,04POIS,f,1,7.95,0
SARDINEHUILEOLIV,Sardines à l'huile d'olives 220g,04POIS,f,1,7.95,0
SARDINEPIMENTESP,Sardines à l'huile d'olive et piment d'espelette 220g AOP,04POIS,f,1,7.95,0
SARHOC,Sardine à l'huile d'olive citron 135g,04POIS,f,1,3.55,0
SARIE,Sariette vivace Bio Plant,05AROM2,f,2,2.3,0
SAUG,Sauge officinale Plant,05AROM2,f,2,2.3,0
SAUGANA,Sauge ananas Bio Plant,05AROM2,f,2,2.3,0
SARIE,Sariette vivace Bio Plant,05AROMCH,f,2,2.3,0
SAUG,Sauge officinale Plant,05AROMCH,f,2,2.3,0
SAUGANA,Sauge ananas Bio Plant,05AROMCH,f,2,2.3,0
SAUGE,Sauge bouquet,02AROM,f,2,1.4,0
SAUPOU,Sauge Pourpre Plant,05AROM,f,2,2,0
SCAFRI,Scarole Frisée,02SALA,f,2,1.5,0
@@ -1031,11 +1031,11 @@ THON,Thon au naturel 400g,04THON,f,2,8.95,2
THONAT,Thon au naturel 160g,04THON,f,1,4.05,2
THONHUI,Thon huile olive 160g,04THON,f,1,6.2,2
THY,Thym bouquet,02AROM,f,2,1.4,0
THYM,Thym commun Bio Plant,05AROM2,f,2,2.3,0
THYMCI,Thym citron Bio Plant,05AROM2,f,2,2.3,0
THYMCIT,Thym citron panaché Bio Plant,05AROM2,f,2,2.3,0
THYM,Thym commun Bio Plant,05AROMCH,f,2,2.3,0
THYMCI,Thym citron Bio Plant,05AROMCH,f,2,2.3,0
THYMCIT,Thym citron panaché Bio Plant,05AROMCH,f,2,2.3,0
THYMOR,Thym Orange Plant,05AROM,f,2,2,0
THYMORANGE,Thym orange Bio Plant,05AROM2,f,2,2.3,0
THYMORANGE,Thym orange Bio Plant,05AROMCH,f,2,2.3,0
THYMVU,Thym vulgaris gold Plant,05AROM,f,2,2,0
TISANEVERVEINE,Tisane Verveine sachet,04TISANE,f,1,4.5,0
TOAN,Ananas Bio Plant,05TOMA,f,2,1.6,0
@@ -1079,10 +1079,10 @@ TOZEB,Green Zebra Bio Plant,05TOMA,f,2,1.6,0
TROISBAIESARCADIE,Trois Baies Arcadie 70 gr,04MOUT,f,1,7.5,0
TRUFPRALIN,Truffes pralinées 100g,12ARTISMON,f,2,4.95,0
TULIPEBOUQUET,Tulipe en bouquet,05PL,f,2,5,0
VALERIANE,Valériane officinale Bio Plant,05AROM2,f,2,2.3,0
VALERIANE,Valériane officinale Bio Plant,05AROMCH,f,2,2.3,0
VEGANSPRITCOCO,Vegan spritz coco choco ss gluten,04CONFISER,f,2,3.95,2
VENTRECHETHONHUILE,Ventreche de Thon Albacore à l'huile d'olive 210g,04POIS,f,1,9.9,0
VERV,Verveine Citronnelle Plant,05AROM2,f,2,2.3,0
VERV,Verveine Citronnelle Plant,05AROMCH,f,2,2.3,0
VINABAL,Vinaigre Balsamique 250 ml,04VINAIGRE,f,2,4.3,2
VINAFLOMIEL,Vinaigre floramiel 25cl,04VINAIGRE,f,2,4.5,2
VINAIGCIDRECOT,Vinaigre de cidre coteaux 75cl,04VINAIGRE,f,2,3.25,2
1 code article famille_code factpoids unitevente prix suivistock
272 CONCOMSCOT Concombre long FR 02CONC f 2 1.9 0
273 CONFITUREC Confiture en pot 370g 12 f 1 5 0
274 CONSOUDE Consoude officinale Bio Plant 05AROM f 2 2.3 0
275 COOKIEEPEAUTRE300 Cookies Epeautre 300 gr 12PROVINCE 04PA f 1 6.7 0
276 CORI Coriandre Bio Plant 05AROM f 2 2.3 0
277 CORIAND Coriande bouquet 02AROM f 1 1.4 0
278 CORIANDRADESCOT Coriandrade 100g 04MOUT f 1 4.3 0
509 LENTIL Lentillons 500 g 04LENT f 2 3.15 2
510 LENTILLEBELUGAKG Lentilles Beluga Kg 04CEREALE t 3 4.5 0
511 LENTILLECORAIL Lentille Corail Vrac 04CEREALE t 3 4.5 2
512 LENTILVERT Lentilles vertes 1kg 12PROVINCE 04LENT f 1 5.5 0
513 LENTILVERTE Lentilles vertes 500 gr 04LENT f 1 3.3 2
514 LENTKG Lentilles Vrac 12PROVINCE 04LENT t 3 4.2 0
515 LENTVERT5 Lentilles vertes 500g 12PROVINCE 04LENT f 1 3 0
516 LEVURE Saf-Levure Boite 125g 04MOUT f 1 1.7 2
517 LIN Lin brun kg 04CEREALE t 3 3.8 2
518 LITCHI Litchi Madagascar 03EXOTIQ t 3 12.45 2
539 MAQVINBLANC Maquereaux au vin blanc 04POIS f 1 3.1 2
540 MARACU Maracuja Ouganda 03CHERI t 3 19.5 2
541 MARJO Marjolaine Plant 05AROM f 2 2.3 0
542 MARJOL Marjolaine Bio Plant 05AROM2 05AROMCH f 2 2.3 0
543 MARRON Marron d'Ardèche 03FS t 3 9.05 2
544 MARRONENTIERVAP Marron entier Cuit Vapeur 200g 03FS f 1 4.2 2
545 MARRONPRECUIT Marron pré-cuit France 03FS f 2 4 2
551 MELCHAMPI Mélange champignons 02CHAM t 3 7 0
552 MELFRUISEC Melange pom poir mang bana 03FS t 3 25 2
553 MELGATEAU Melange gateau 30g 12ARTISMON f 2 2.4 0
554 MELISSE Mélisse Bio Plant 05AROM2 05AROMCH f 2 2.3 0
555 MELOGAL Melon Galia Espagne 03MELON t 3 2.9 2
556 MELON Melon Charentais France 03MELON t 3 3.5 2
557 MELONCAN Melon Cantaloup Italie kg 03MELON t 3 2.5 2
561 MELPLT Melon Bio Plant 05MELON f 2 2.2 0
562 MELWOKEPIC Mélange wok épicé 15TRANSLEG t 3 14 0
563 MELWOKNAT Mélange wok nature 15TRANSLEG t 3 12 0
564 MEMA Menthe marocaine Bio Plant 05AROM2 05AROMCH f 2 2.3 0
565 MENCH Menthe chocolat Plant 05AROM2 05AROMCH f 2 2.3 0
566 MENMA Menthe Pomme Plant Plant Menthe Pomme 11MENTHE f 2 2 0
567 MENSPI Menthe spicata Plant 05AROM f 2 2 0
568 MENTHE Menthe 02AROM f 2 1.2 0
569 MENTORA Menthe orange Bio Plant 05AROM2 05AROMCH f 2 2.3 0
570 MENTPOM Menthe pomme Bio Plant 05AROM2 05AROMCH f 2 2.3 0
571 MEPO Menthe poivrée Plant 05AROM2 05AROMCH f 2 2.3 0
572 MERI Meringue sachet 04PA f 2 1.2 2
573 MESCLU Mesclun de chou asiatique 02SALA t 3 13 0
574 MESCLUN Mesclun 02SALA t 3 5 0
668 ORAOVALI Orange Valancia Italie 03ORANGE t 3 2 2
669 ORASALA Orange à jus kg Espagne 03ORANGE t 3 2.2 2
670 ORIG Origan Plant 05AROM f 2 2 0
671 ORIGA Origan Bio Plant 05AROM2 05AROMCH f 2 2.3 0
672 ORIGAN Origan vulgaire Plant 05AROM f 2 2 0
673 ORMALTA Orange maltaise tarocco Italie 03ORANGE t 3 2.8 2
674 ORTILLETTE33 Ortillette 33cl 04BOISSONS f 2 2.6 2
675 ORTILLETTE75 Ortillette 75cl 04BOISSONS f 2 4.9 2
676 OSEILLE Oseille Bio Plant 05AROM2 05AROMCH f 2 2.3 0
677 OSEILPOU Oseille pourpre Bio Plant 05AROM2 05AROMCH f 2 2.3 0
678 OSTARA pomme ostara 02POMM t 3 1.5 0
679 P4GR05 Pain 4 graines 500 g 04PA f 2 3.1 2
680 PAINB Pain blé moulé 750g 04PA f 2 2.9 2
681 PAINBLE Pain soldé 04PA f 2 1 2
682 PAINBLECOMPLET500 Complet Blé 500g 12PROVINCE 04PA f 1 3.5 0
683 PAINBLEDEMICOM500 Semi-complet Blé 500g 12PROVINCE 04PA f 2 3.3 0
684 PAINBLEMULTIGR500 Multi-graines 500g 12PROVINCE 04PA f 1 4.5 0
685 PAINBLENOIX500 Noix 500g 12PROVINCE 04PA f 1 4.8 0
686 PAINBLERAISIN500 Raisins Pain 500g 12PROVINCE 04PA f 1 4.5 0
687 PAINEP Pain de vieilles variétés 500g 04PA f 2 2.9 2
688 PAINEPEAUTRE500 Epeautre 500g 12PROVINCE 04PA f 1 4.8 0
689 PAINEPICE Pain d'épices nature fermier 350g 04PA f 1 7.9 2
690 PAINEPICECHOCO Pain d'épices chocolat orange 350g 04PA f 1 8.4 2
691 PAINEPICENAT Pain d'épice nature 12ARTISMON f 2 5.6 0
695 PAINMI Pain de mie 500 g 04PA f 2 3.6 2
696 PAINNOIX Pain aux noix 500g 04PA f 1 3.1 2
697 PAINOI Pain aux graines courge 500g 04PA f 2 3.1 2
698 PAINPETEPEAUTRE500 Petit Epeautre 500g 12PROVINCE 04PA f 1 6.2 0
699 PAINS Salade Pain de sucre kg 02SALA t 3 3.5 0
700 PAINSARRASINRIZ400 Sarrasin Riz 400g 12PROVINCE 04PA f 1 4.6 0
701 PAINSEIGLE500 Seigle 500g 12PROVINCE 04PA f 1 3.9 0
702 PAIRAI Pain aux raisins 500g 04PA f 2 3.1 2
703 PAMAN Poudre d'amande vrac 03FS t 3 18.3 2
704 PANAIS Panais Jardins 02PANA t 3 3.3 0
750 PECHJ Pêche plate france 03PECHE t 3 7.75 2
751 PECHJA Pêche de vigne 03PECHE t 3 6.7 2
752 PECPLA Pêche Sanguine 03PECHE t 3 7.55 2
753 PEFR Persil frisé Bio Plant 05AROM2 05AROMCH f 2 2.3 0
754 PEPE05 Epeautre 500 g 04PA f 2 3.2 2
755 PEPL Persil plat Bio Plant 05AROM2 05AROMCH f 2 2.3 0
756 PEPOIS Petit pois Jardins 02POIS t 3 8 0
757 PERSIL Persil vrac 02AROM t 3 28 0
758 PERSILFR Persil Bouquet 02AROM f 2 1 2
766 PHYSALIS Physalis Bio Plant 05PLANT f 2 2.3 0
767 PIGNON Pignons de Pin Espagne 03FS f 1 17.3 2
768 PIMENT Piment Bio Plant 05SOLAN f 2 1.5 0
769 PIMPREN Pimprenelle Bio Plant 05AROM2 05AROMCH f 2 2.3 0
770 PISSEN Pissenlit 02SALA t 3 18 0
771 PISTA Pistache déc.vrac Italie 03FS t 3 63 2
772 PISTA250 Pistache décortiquée 250 grs 03FS f 2 14.55 2
896 RAICHRO Raisin rosé Chasselas France 03RAISIN t 3 6.7 2
897 RAICLA Raisin blanc vittoria italie 03RAISIN t 3 4.3 2
898 RAIDANFR Raisin blanc Danlas France 03RAISIN t 3 6 2
899 RAIFO Raifort Bio Plant 05AROM2 05AROMCH f 2 2.3 0
900 RAIITA raisin exalta sans pépins France 03RAISIN t 3 6.95 2
901 RAILAV Raisin Lavallée Noir 03RAISIN t 3 6.2 2
902 RAILIV Raisin muscat noir 03RAISIN t 3 7.3 2
931 RIZTHAIJASMB Riz thai jasmin blanc 500g 12ARTISMON f 2 3.05 0
932 RIZTHAIJASMC Riz thai jasmin complet 500g 12ARTISMON f 2 2.75 0
933 RIZTRIOCAMARGUE Riz Trio Camargue Vrac 04CEREALE t 3 6.7 2
934 ROMA Romarin Bio Plant 05AROM2 05AROMCH f 2 2.3 0
935 ROOIBOS Rooibos afrique super fruit 80g 12ARTISMON f 2 6.4 0
936 ROQU Roquette poids 02SALA t 3 6 0
937 ROQUE Roquette sauvage Plant 05AROM f 2 2 0
938 ROQUEFORT Roquefort papillon 04FROMAGE f 2 3.95 2
939 ROQUEPL Roquette Bio Plant 05AROM2 05AROMCH f 2 2.3 0
940 ROQUET Roquette 02SALA t 3 12 0
941 ROULEAUPRINTEMPS Rouleau de Printemps Kg 15TRANSLEG t 3 20 0
942 RUTABA Rutabaga Jardins 02NARU t 3 2.6 0
974 SARDINEHUILEOLIV Sardines à l'huile d'olives 220g 04POIS f 1 7.95 0
975 SARDINEPIMENTESP Sardines à l'huile d'olive et piment d'espelette 220g AOP 04POIS f 1 7.95 0
976 SARHOC Sardine à l'huile d'olive citron 135g 04POIS f 1 3.55 0
977 SARIE Sariette vivace Bio Plant 05AROM2 05AROMCH f 2 2.3 0
978 SAUG Sauge officinale Plant 05AROM2 05AROMCH f 2 2.3 0
979 SAUGANA Sauge ananas Bio Plant 05AROM2 05AROMCH f 2 2.3 0
980 SAUGE Sauge bouquet 02AROM f 2 1.4 0
981 SAUPOU Sauge Pourpre Plant 05AROM f 2 2 0
982 SCAFRI Scarole Frisée 02SALA f 2 1.5 0
1031 THONAT Thon au naturel 160g 04THON f 1 4.05 2
1032 THONHUI Thon huile olive 160g 04THON f 1 6.2 2
1033 THY Thym bouquet 02AROM f 2 1.4 0
1034 THYM Thym commun Bio Plant 05AROM2 05AROMCH f 2 2.3 0
1035 THYMCI Thym citron Bio Plant 05AROM2 05AROMCH f 2 2.3 0
1036 THYMCIT Thym citron panaché Bio Plant 05AROM2 05AROMCH f 2 2.3 0
1037 THYMOR Thym Orange Plant 05AROM f 2 2 0
1038 THYMORANGE Thym orange Bio Plant 05AROM2 05AROMCH f 2 2.3 0
1039 THYMVU Thym vulgaris gold Plant 05AROM f 2 2 0
1040 TISANEVERVEINE Tisane Verveine sachet 04TISANE f 1 4.5 0
1041 TOAN Ananas Bio Plant 05TOMA f 2 1.6 0
1079 TROISBAIESARCADIE Trois Baies Arcadie 70 gr 04MOUT f 1 7.5 0
1080 TRUFPRALIN Truffes pralinées 100g 12ARTISMON f 2 4.95 0
1081 TULIPEBOUQUET Tulipe en bouquet 05PL f 2 5 0
1082 VALERIANE Valériane officinale Bio Plant 05AROM2 05AROMCH f 2 2.3 0
1083 VEGANSPRITCOCO Vegan spritz coco choco ss gluten 04CONFISER f 2 3.95 2
1084 VENTRECHETHONHUILE Ventreche de Thon Albacore à l'huile d'olive 210g 04POIS f 1 9.9 0
1085 VERV Verveine Citronnelle Plant 05AROM2 05AROMCH f 2 2.3 0
1086 VINABAL Vinaigre Balsamique 250 ml 04VINAIGRE f 2 4.3 2
1087 VINAFLOMIEL Vinaigre floramiel 25cl 04VINAIGRE f 2 4.5 2
1088 VINAIGCIDRECOT Vinaigre de cidre coteaux 75cl 04VINAIGRE f 2 3.25 2

View File

@@ -126,7 +126,7 @@ code,famille,code_parent,arborescence
05TOMA,Tomate,05PLANT,Jardin.Plants.Tomate
06,** PRESTATIONS,,Jardin.Prestations
06PE,Prestations environnements,06,Jardin.Prestations.Environnement
O5AROM,** PLANTS Aromates,05PLANT,Jardin.Plants.Aromates
05AROM,** PLANTS Aromates,05PLANT,Jardin.Plants.Aromates
05AROMAB,Aromates A - B,05AROM,Jardin.Plants.Aromates.AB
05AROMCH,Aromates C - H,05AROM,Jardin.Plants.Aromates.CH
12,** Producteurs,,Jardin.Producteurs
1 code famille code_parent arborescence
126 05TOMA Tomate 05PLANT Jardin.Plants.Tomate
127 06 ** PRESTATIONS Jardin.Prestations
128 06PE Prestations environnements 06 Jardin.Prestations.Environnement
129 O5AROM 05AROM ** PLANTS Aromates 05PLANT Jardin.Plants.Aromates
130 05AROMAB Aromates A - B 05AROM Jardin.Plants.Aromates.AB
131 05AROMCH Aromates C - H 05AROM Jardin.Plants.Aromates.CH
132 12 ** Producteurs Jardin.Producteurs

View File

@@ -0,0 +1,83 @@
create extension if not exists ltree;
create extension if not exists pgtap;
create extension if not exists postgis;
create extension if not exists pgrouting;
create extension if not exists vector;
create table adherent (
id int primary key,
nom text,
prenom text,
genre smallint,
naissance date,
codepostal text
);
create table famille (
code text primary key,
famille text,
code_parent text, -- references famille(code)
arborescence ltree
);
create table article (
code text primary key,
article text,
famille_code text, -- references famille(code)
factpoids boolean,
unitevente int,
prix decimal,
suivistock int
);
create table ticket (
id int primary key,
date_ticket timestamp,
adherent_id int, -- references adherent(id)
mode_rglt int
);
create table ligne (
id int primary key,
ticket_id int, --references ticket (id),
article_code text, -- references article (code)
prix_unitaire decimal,
quantite decimal
);
CREATE TABLE route (
id int primary key,
source int,
target int,
cost double precision,
reverse_cost double precision
);
CREATE TABLE produits (
id SERIAL PRIMARY KEY,
nom TEXT,
caracteristiques VECTOR(6)
);
INSERT INTO produits (nom, caracteristiques) VALUES
('Tomate', '[0.6, 0.3, 0.3, 1.0, 0.5, 1.0]'),
('Concombre', '[0.2, 0.1, 0.9, 1.0, 0.0, 0.0]'),
('Courgette', '[0.3, 0.1, 0.5, 1.0, 0.0, 0.0]'),
('Carotte', '[0.5, 0.1, 0.8, 0.5, 0.0, 1.0]'),
('Poivron', '[0.4, 0.2, 0.6, 1.0, 0.0, 1.0]'),
('Aubergine', '[0.2, 0.1, 0.4, 1.0, 0.0, 0.0]'),
('Pomme', '[0.8, 0.3, 0.9, 1.0, 1.0, 1.0]'),
('Poire', '[0.7, 0.2, 0.7, 1.0, 1.0, 0.0]'),
('Fraise', '[0.9, 0.4, 0.7, 1.0, 1.0, 1.0]'),
('Cerise', '[0.8, 0.3, 0.6, 1.0, 1.0, 1.0]'),
('Citron', '[0.2, 1.0, 0.6, 1.0, 1.0, 1.0]'),
('Orange', '[0.7, 0.6, 0.7, 1.0, 1.0, 1.0]'),
('Banane', '[0.9, 0.1, 0.2, 1.0, 1.0, 0.0]'),
('Raisin', '[0.8, 0.3, 0.5, 1.0, 1.0, 1.0]'),
('Pastèque', '[0.8, 0.2, 0.6, 1.0, 1.0, 1.0]'),
('Melon', '[0.9, 0.2, 0.5, 1.0, 1.0, 1.0]'),
('Betterave', '[0.5, 0.1, 0.4, 0.0, 0.0, 1.0]'),
('Radis', '[0.2, 0.3, 0.9, 0.5, 0.0, 1.0]'),
('Brocoli', '[0.1, 0.1, 0.6, 0.0, 0.0, 0.0]'),
('Chou-fleur', '[0.1, 0.1, 0.7, 0.0, 0.0, 0.0]');

View File

@@ -0,0 +1,11 @@
create view nb_total_familles as
select count(*) as nb_total_familles from famille;
create view nb_total_articles as
select count(*) as nb_total_articles from article;
create view nb_total_tickets as
select count(*) as nb_total_tickets from ticket;
create view nb_total_adherents as
select count(*) as nb_total_adherents from adherent;

View File

@@ -0,0 +1,28 @@
SELECT plan(4);
SELECT is(
(SELECT nb_total_familles FROM nb_total_familles),
137::bigint,
'La table famille contient 137 enregistrements'
);
SELECT is(
(SELECT nb_total_articles FROM nb_total_articles),
1099::bigint,
'La table article contient 1099 enregistrements'
);
SELECT is(
(SELECT nb_total_adherents FROM nb_total_adherents),
2439::bigint,
'La table adherent contient 2439 enregistrements'
);
SELECT is(
(SELECT nb_total_tickets FROM nb_total_tickets),
101616::bigint,
'La table ticket contient 101 616 enregistrements'
);
-- Termine le test
SELECT * FROM finish();

View File

@@ -1,42 +0,0 @@
create extension if not exists ltree;
create table adherent (
id int primary key,
nom text,
prenom text,
genre smallint,
naissance date,
codepostal text
);
create table famille (
code text primary key,
famille text,
code_parent text, -- references famille(code)
arborescence ltree
);
create table article (
code text primary key,
article text,
famille_code text, -- references famille(code)
factpoids boolean,
unitevente int,
prix decimal,
suivistock int
);
create table ticket (
id int primary key,
date_ticket timestamp,
adherent_id int, -- references adherent(id)
mode_rglt int
);
create table ligne (
id int primary key,
ticket_id int, --references ticket (id),
article_code text, -- references article (code)
prix_unitaire decimal,
quantite decimal
);