Files
sql/docker-entrypoint-initdb.d/initdb.sql

53 lines
1.1 KiB
MySQL
Raw Normal View History

2025-08-28 11:45:01 +02:00
create table adherent (
id int primary key,
nom text,
prenom text,
genre text,
naissance date,
pays text
);
\COPY adherent FROM '/tmp/adherent.csv' (FORMAT CSV, header, ENCODING 'UTF8');
2025-08-28 07:13:19 +02:00
create table famille (
2025-08-28 13:54:30 +02:00
code text primary key,
famille text,
code_parent text
2025-08-28 07:13:19 +02:00
);
\COPY famille FROM '/tmp/famille.csv' (FORMAT CSV, header, ENCODING 'UTF8');
create table article (
code text primary key,
article text,
famille text, -- references famille(famille)
factpoids int,
unitevente int,
prix decimal,
unitepoids int,
publie int,
suivistock int,
sommeil int
);
2025-08-28 09:38:07 +02:00
\COPY article FROM '/tmp/article.csv' (FORMAT CSV, header, ENCODING 'UTF8');
2025-08-28 07:13:19 +02:00
create table ticket (
id int primary key,
2025-08-28 11:45:01 +02:00
date_ticket timestamp,
client_id int,
2025-08-28 11:29:31 +02:00
mode_rglt int
2025-08-28 07:13:19 +02:00
);
2025-08-28 09:38:07 +02:00
\COPY ticket FROM '/tmp/ticket.csv' (FORMAT CSV, header, ENCODING 'UTF8');
2025-08-28 07:13:19 +02:00
create table ligne (
id int primary key,
ticket_id int, --references ticket (id),
article text, -- references article (code)
prix_unitaire decimal,
2025-08-28 09:38:07 +02:00
quantite decimal
2025-08-28 07:13:19 +02:00
);
2025-08-28 09:38:07 +02:00
\COPY ligne FROM '/tmp/ligne.csv' (FORMAT CSV, header, ENCODING 'UTF8');