FEATURE ajout reprise de localisations - prepare
This commit is contained in:
parent
3651b1a09b
commit
fd4e68faa8
@ -67,7 +67,7 @@ On peut aussi utiliser la fonction `\copy` de psql pour charger un fichier csv d
|
|||||||
|
|
||||||
Tout d'abord, les tables du schéma "import" doivent être préparées avec le script `prepare-import.sql`.
|
Tout d'abord, les tables du schéma "import" doivent être préparées avec le script `prepare-import.sql`.
|
||||||
|
|
||||||
Puis on importe les 4 fichiers csv:
|
Puis on importe les fichiers csv:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
psql chill-import
|
psql chill-import
|
||||||
@ -75,6 +75,8 @@ chill-import=# \copy "import".choix_personnes FROM 'choix_personnes.csv' DELIMIT
|
|||||||
chill-import=# \copy "import".personnes FROM 'personnes.csv' DELIMITER ',' CSV HEADER
|
chill-import=# \copy "import".personnes FROM 'personnes.csv' DELIMITER ',' CSV HEADER
|
||||||
chill-import=# \copy "import".choix_periodes FROM 'choix_periodes.csv' DELIMITER ',' CSV HEADER
|
chill-import=# \copy "import".choix_periodes FROM 'choix_periodes.csv' DELIMITER ',' CSV HEADER
|
||||||
chill-import=# \copy "import".periodes FROM 'periodes.csv' DELIMITER ',' CSV HEADER
|
chill-import=# \copy "import".periodes FROM 'periodes.csv' DELIMITER ',' CSV HEADER
|
||||||
|
chill-import=# \copy "import".choix_localisations FROM 'choix_localisations.csv' DELIMITER ',' CSV HEADER
|
||||||
|
chill-import=# \copy "import".localisations FROM 'localisations.csv' DELIMITER ',' CSV HEADER
|
||||||
```
|
```
|
||||||
|
|
||||||
Enfin, on exporte la base de données en sql:
|
Enfin, on exporte la base de données en sql:
|
||||||
|
Binary file not shown.
@ -1,3 +1,5 @@
|
|||||||
|
CREATE SCHEMA "import";
|
||||||
|
|
||||||
CREATE TABLE "import".choix_personnes (
|
CREATE TABLE "import".choix_personnes (
|
||||||
civility varchar(50) NULL,
|
civility varchar(50) NULL,
|
||||||
gender varchar(50) NULL,
|
gender varchar(50) NULL,
|
||||||
@ -79,3 +81,26 @@ CREATE TABLE "import".periodes (
|
|||||||
comment4_content varchar(50) NULL,
|
comment4_content varchar(50) NULL,
|
||||||
comment5_content varchar(50) NULL
|
comment5_content varchar(50) NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "import".choix_localisations (
|
||||||
|
title varchar(50) NULL,
|
||||||
|
"addressRequired" varchar(32) NULL,
|
||||||
|
"availableForUsers" boolean DEFAULT TRUE,
|
||||||
|
"contactData" varchar(32) NULL,
|
||||||
|
"defaultFor" varchar(32) NULL,
|
||||||
|
"editableByUsers" boolean DEFAULT TRUE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "import".localisations (
|
||||||
|
id varchar(50) NULL,
|
||||||
|
locname varchar(50) NULL,
|
||||||
|
phonenumber varchar(50) NULL,
|
||||||
|
phonenumber1 varchar(50) NULL,
|
||||||
|
email varchar(50) NULL,
|
||||||
|
loctype varchar(50) NULL,
|
||||||
|
street varchar(50) NULL,
|
||||||
|
extra varchar(50) NULL,
|
||||||
|
streetnumber varchar(50) NULL,
|
||||||
|
postcode varchar(50) NULL,
|
||||||
|
country varchar(50) NULL
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user