ImportMassif » Historique » Version 3
Jonathan Schaeffer, 18/08/2015 10:00
1 | 1 | Jonathan Schaeffer | h1. Import massif |
---|---|---|---|
2 | |||
3 | Ce document décrit comment a été réalisé l'import massif d'une base de donnée existante. |
||
4 | |||
5 | La base de donnée telle que décrite dans le document#106 est très proche de la base access qui était utilisée précédemment. |
||
6 | |||
7 | L'import est réalisé à partir d'un ensemble de fichiers au format CSV dont voici la liste ainsi que les en-têtes nécessaires : |
||
8 | |||
9 | |_. Table dans la base |_. Nom du fichier CSV |_. Entêtes |_. Lien vers un exemple | |
||
10 | | Sectors | sectors.csv | "ID_SECTOR";"SECTOR_ORDER";"SECTOR_NAME";"COMMENT" | "sectors.csv":https://tucuxi.univ-brest.fr/attachments/406/SECTOR.txt | |
||
11 | | Themes | themes.csv | "CODE_THEME";"THEME_NAME";"COMMENT" | "themes.csv":https://tucuxi.univ-brest.fr/attachments/407/THEME.txt | |
||
12 | | Datasources | datasources.csv | "ID_DATA_SOURCE";"SOURCE_NAME";"DESC_SOURCE";"COMMENT" | "datasources.csv":https://tucuxi.univ-brest.fr/attachments/410/DATA_SOURCE.txt | |
||
13 | | | datastrategies.csv | "ID_DATA_STRATEGY";"SOURCE";"THEME";"POINT";"SITE";"COMMENT" | "datastrategies.csv":https://tucuxi.univ-brest.fr/attachments/411/DATA_STRATEGY.txt | |
||
14 | | Points | points.csv | "ID_POINT";"POINT_NAME";"PT_ACTIVITY";"LAT_PT";"LONG_PT";"DIRECTION";"SITE";"COMMENT" | "points.csv":https://tucuxi.univ-brest.fr/attachments/412/POINT.txt | |
||
15 | | Sites | sites.csv | "ID_SITE";"SITE_NAME";"SITE_ACTIVITY";"SECTOR";"COMMENT" | "sites.csv":https://tucuxi.univ-brest.fr/attachments/413/SITE.txt | |
||
16 | | Stations | stations.csv | "ID_STATION";"DATA_STRATEGY";"DATE_STATION";"DAY_KNOWN";"LAT_STA";"LONG_STA";"DIRECTION";"COMMENT" | "stations.csv":https://tucuxi.univ-brest.fr/attachments/512/STATION_V2.txt | |
||
17 | | | collectionlists.csv | "ID_COLLECTION_LIST";"COLLECTION_LIST";"COMMENT" | "collectionlists.csv":https://tucuxi.univ-brest.fr/attachments/424/COLLECTION_LIST.txt | |
||
18 | | Collections | collections.csv | "ID_COLLECTION";"STATION";"COLLECTION_NAME";"SAMPL_METH";"COLLECTION_SIZE";"UNIT";"LAT_COLL";"LONG_COLL";"DIRECTION";"COMMENT" | "collections.csv":https://tucuxi.univ-brest.fr/attachments/513/COLLECTION_V2.txt| |
||
19 | | Units | units.csv | "ID_UNIT";"UNIT_NAME";"UNIT_SYMB";"COMMENT" | | |
||
20 | | Samplemethods | samplemethods.csv | "ID_SAMPLE_METH";"SAMPLE_METH_NAME";"SAMPLER";"COMMENT" | "samplemethods.csv":https://tucuxi.univ-brest.fr/attachments/428/SAMPL_METH.txt| |
||
21 | | Samplers | samplers.csv | "ID_SAMPLER";"SAMPLER_NAME";"DESC_SAMPLER";"SAMPLER_SIZE";"UNIT";"COMMENT"| "samplers.csv":https://tucuxi.univ-brest.fr/attachments/427/SAMPLERS.txt | |
||
22 | | Samples | samples.csv | "ID_SAMPLE";"SAMPLE_NAME";"COLLECTION";"SAMPLE_SIZE";"UNIT";"COMMENT";"RESULTS" | "samples.csv":https://tucuxi.univ-brest.fr/attachments/514/SAMPLE_V2.txt | |
||
23 | | Results | results.csv | "ID_RESULTS";"COLLECTION";"SAMPLE";"N°RESULT";"SPECIES";"FCTNAL_GR";"NUM_VAL";"PARAM";"METH_ANA";"BROKEN";"UNIT";"RESULT_TYP";"COMMENT" | "results":https://tucuxi.univ-brest.fr/attachments/515/RESULTS_V2.txt | |
||
24 | | Variables | parameters.csv |"ID_PARAM";"PARAM_NAME";"COMMENT" | "parameters.csv":https://tucuxi.univ-brest.fr/attachments/449/PARAMETERS.txt | |
||
25 | | Meth_anas | meth_ana.csv | "ID_METH_ANA";"METH_ANA_NAME";"METH_ANA_DESC";"COMMENT" | "meth_ana.csv":https://tucuxi.univ-brest.fr/attachments/448/METH_ANA.txt | |
||
26 | | Functionalgroups | fctnal_gr.csv | "ID_FCTNAL_GR";"FCTNAL_GR_NAME";"DESC_FCTNAL_GR";"COMMENT"| "fctnal_gr.csv":https://tucuxi.univ-brest.fr/attachments/447/FCTNAL_GR.txt | |
||
27 | | Taxonomies | taxonsaphiaid.csv | CODE_SP;ScientificName_initial;AphiaID_accepted;ScientificName_accepted;Authority_accepted | "taxonsaphiaid.csv":https://tucuxi.univ-brest.fr/attachments/502/worms_matched_V2.csv | |
||
28 | | Ecologroups | ecologroups.csv| "NOM_SP";"ECOLO_GR";"DESC_GR_ECOL" | "ecologroups.csv":https://tucuxi.univ-brest.fr/attachments/516/ECOLOGIC_GR_V2.txt | |
||
29 | | Trophic_groups | trophic_gr.csv |"SPECIES";"CODE_TROPHIC_GR";"TROPHIC_GR";"ALIM_NAT";"ALIM_STAT";"ALIM_ENVT";"SIZE_RAP" | "trophic_gr.csv":https://tucuxi.univ-brest.fr/attachments/download/517/TROPHIC_GR_V2 | |
||
30 | | |
||
31 | 2 | Jonathan Schaeffer | |
32 | Le script qui réalise l'import massif est source:db/seeds.rb |
||
33 | |||
34 | L'import massif est appelé à partir de la commande : |
||
35 | |||
36 | 3 | Jonathan Schaeffer | <pre> |
37 | 2 | Jonathan Schaeffer | RAILS_ENV=production rake db:seed |
38 | 3 | Jonathan Schaeffer | </pre> |
39 | 2 | Jonathan Schaeffer | |
40 | Une demande est en cours pour transférer cet import sous forme de tâches rake indépendantes (#1261). |