Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
intro_histoire_numerique:modele_logique [2020/10/31 16:14] Francesco Beretta [Ajouter de nouvelles tables] |
intro_histoire_numerique:modele_logique [2020/10/31 16:37] Francesco Beretta [Le modèle logique ou relationnel] |
||
---|---|---|---|
Ligne 49: | Ligne 49: | ||
\\ | \\ | ||
- | person(//pk_person//, name, definition, gender, death_date, __fk_birth__) \\ | + | person(//pk_person//, name, definition, gender, death_date, __fk_birth__, notes) \\ |
- | appellation(//pk_appellation//, __pk_person__, name) \\ | + | appellation(//pk_appellation//, __pk_person__, name, sources, notes) \\ |
- | tag(//pk_tag//, __fk_parent_tag__, name, definition) \\ | + | tag(//pk_tag//, __fk_parent_tag__, name, definition, notes) \\ |
- | tags(//pk_tags//, __fk_person__, __fk_tag__) \\ | + | tags(//pk_tags//, __fk_person__, __fk_tag__, notes) \\ |
- | pursuit(//pk_pursuit//, __fk_person__, __fk_occupation__, __fk_organisation__, begin_date, end_date) \\ | + | pursuit(//pk_pursuit//, __fk_person__, __fk_occupation__, __fk_organisation__, begin_date, end_date, sources, notes) \\ |
- | organisation(//pk_organisation//, __fk_geographical_place__, name, definition) \\ | + | organisation(//pk_organisation//, __fk_geographical_place__, name, definition, notes) \\ |
- | occupation(//pk_occupation//, name, definition) \\ | + | occupation(//pk_occupation//, name, definition, notes) \\ |
- | specializes_occupation(//pk_specializes_occupation//, __fk_parent_occupation__, __fk_child_occupation__) \\ | + | specializes_occupation(//pk_specializes_occupation//, __fk_parent_occupation__, __fk_child_occupation__, notes) \\ |
- | birth(//pk_birth//, date, __fk_geographical_place__, __fk_union__) \\ | + | birth(//pk_birth//, date, __fk_geographical_place__, __fk_union__, sources, notes) \\ |
- | union(//pk_union//, __fk_union_type__, begin_date, end_date, __fk_person_1__, __fk_person_2__) \\ | + | union(//pk_union//, __fk_union_type__, begin_date, end_date, __fk_person_1__, __fk_person_2__, sources, notes) \\ |
- | union_type(//pk_union_type//, name, definition) \\ | + | union_type(//pk_union_type//, name, definition, notes) \\ |
- | geographical_place(//pk_geographical_place//, name, definition, longitude,latitude, __fk_geographical_place_type__) \\ | + | geographical_place(//pk_geographical_place//, name, definition, longitude,latitude, __fk_geographical_place_type__, notes) \\ |
- | geographical_place_type(//pk_geographical_place_type//, name, definition) \\ | + | geographical_place_type(//pk_geographical_place_type//, name, definition, __fk_parent_geographical_place_type__, notes) \\ |
Ligne 129: | Ligne 129: | ||
* les champs //longitude// et //latitude// qui seront de type NUMERIC | * les champs //longitude// et //latitude// qui seront de type NUMERIC | ||
* ajouté la clé étrangère vers la table 'geographical_place_type' | * ajouté la clé étrangère vers la table 'geographical_place_type' | ||
+ | * la colonne s'appellera 'fk_geographical_place_type' | ||
+ | * elle sera de type INTEGER | ||
+ | * on coche ensuite Foreign Key et on ouvre 'Configure' | ||
+ | * on choisit la 'Foreign table' : geographical_place_type | ||
+ | * on choisit la 'Foreign column': 'pk_geographical_place_type' | ||
+ | * on coche MATCH ce qui va introduire un contrôle automatique | ||
+ | * on applique: 'Apply' | ||
+ | * on crée la colonne | ||
+ | * on n'oublie pas d'__enregistrer la nouvelle table__ ! | ||
+ | |||
+ | |||
+ | On procède ainsi pour toutes les autres tables. | ||
+ | |||
+ | A noter que on ne pourra pas créer la table 'person' ou 'birth' directement avec toutes les clé étrangères, car 'birth' dépend de 'union' qui dépend à son tour de 'person'. | ||
+ | * on créer d'abord la table 'person' | ||
+ | * on ajoute la colonne INTEGER pour la clé étrangère vers 'birth' qui sera appelée 'fk_birth' et on ne renseigne pas le lien vers la clé primaire | ||
+ | * on enregistre la table 'person' | ||
+ | * on crée ensuite 'union', puis 'birth' | ||
+ | * enfin on va modifier la table 'person' (click droit sur la table et 'Edit the table'), modifier la colonne (double-click sur la colonne) et on ajoutera la référence de la clé étrangère vers la table 'birth' | ||
+ | |||