/[drupal]/contributions/modules/family/family.install
ViewVC logotype

Contents of /contributions/modules/family/family.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Sat Dec 6 03:18:15 2008 UTC (11 months, 2 weeks ago) by pyutaros
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +0 -0 lines
File MIME type: text/x-php
#322607 by Microbe:  Ascendants and Descendants tabs appear on every node type
#326432 by Microbe:  New 6.x-1.0-beta2 instalation - warning: mysql_fetch_array()
#339263 by Microbe:  Misspelling of word "Birth" in table
#339265 by Microbe:  Marriage type fields requested, in addition to "Religious"
#331459 by Microbe:  GEDCOM data confused on import
1 <?php
2 // $Id: family.install,v 1.3.2.1 2008/10/09 01:55:57 pyutaros Exp $
3
4 /* ---------------------------------
5 -- FAMILY_INDIVIDUAL
6 -- vid: vocabulary id? (PRIMARY)
7 -- nid: node id (PRIMARY)
8 -- title_format: contains the specified format for concetenating tokens
9 -- firstname: the individual's first name
10 -- middlename: the individual's middle name
11 -- lastname: the individual's birth surname
12 -- gender: acceptable values are M or F or ?
13 -- birthdate: the individual's date of birth
14 -- birthplace: the individual's place of birth (This will eventually be a reference to the location node)
15 -- deathdate: the individual's date of death
16 -- deathplace: the individual's place of death (This will eventually be a reference to the location node)
17 -- children_num: the number of children that an individual has (this is be a stored calculation, so it doesn't have to be figured every time the node is viewed)
18 -- ancestor_group: the family an individual is a child of (This will eventually be a reference to the group node)
19 -- descendent_group: NOT A FIELD - Identified by querying GROUP node's 'parent1' and 'parent2' fields for a match.
20 -- media: a picture, video or audio of the individual (This will eventually store a list of all media that link to the individual node)
21
22 -- FAMILY_GROUP
23 -- vid: vocabulary id? (PRIMARY)
24 -- nid: node id (PRIMARY)
25 --title_format: contains the specified format for concetenating tokens
26 --marr_type: The type of union between parents (Currently only accepts unmarried and religious)
27 --marr_date: Date of declared union if any
28 --marr_plac: The place of union if any official partnership was declared
29 --div_date: Date the union was nullified.
30 --div_plac: Location of nullification the union (could be a courthouse, or just the place the couple was living at the time)
31 --parent1: Parent of the family (Gender neutral field. Will be a referral to an individual node, containing that node's nid)
32 --parent2: Parent of the family (Gender neutral field. Will be a referral to an individual node, containing that node's nid)
33 -- media: a picture, video or audio of the group (This will eventually store a list of all media that link to the individual node)
34 --CHILDREN of a group are identified by querying an INDIVIDUAL node's 'ancestor_group' field for a match.
35
36 FAMILY_LOCATION
37 -- vid: vocabulary id? (PRIMARY)
38 -- nid: node id (PRIMARY)
39 --title_format: contains the specified format for concetenating tokens
40 --building: If the location is not a residence, the name of the location (i.e. Springfield County Courthouse)
41 --street: Street address
42 --city: Name of the city
43 --county: Name of county if one exists
44 --state_province: Name of state or province
45 --country: Name of country
46 -- media: a picture, video or audio of the location (This will eventually store a list of all media that link to the individual node)
47
48 FAMILY_VARIABLE
49 -- name: Name of the family module variable being stored.
50 -- variable: Value of the variable being stored.
51 ------------------------------------ */
52
53 //*************************************************
54 // NEW INSTALL FUNCTION FOR DRUPAL 6.x
55 //*************************************************
56
57 function family_install() {
58 drupal_install_schema('family');
59 }
60 function family_schema() {
61 $schema['family_individual'] = array(
62 'fields' => array(
63 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
64 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
65 'title_format' => array(
66 'type' => 'varchar',
67 'length' => 128,
68 'not null' => FALSE,
69 ),
70 'firstname' => array(
71 'type' => 'varchar',
72 'length' => 128,
73 'not null' => FALSE,
74 'default' => 'Unknown',
75 ),
76 'middlename' => array(
77 'type' => 'varchar',
78 'length' => 128,
79 'not null' => FALSE,
80 'default' => 'Unknown',
81 ),
82 'lastname' => array(
83 'type' => 'varchar',
84 'length' => 128,
85 'not null' => FALSE,
86 'default' => 'Unknown',
87 ),
88 'gender' => array(
89 'type' => 'varchar', // Needs to be changed to SET
90 'length' => 2,
91 'not null' => FALSE,
92 'default' => '?',
93 ),
94 'birthdate' => array(
95 'type' => 'datetime', // This creates a datetime format not date
96 'not null' => FALSE,
97 ),
98 'birthplace' => array(
99 'type' => 'varchar',
100 'length' => 128,
101 'not null' => FALSE,
102 'default' => 'Unknown',
103 ),
104 'deathdate' => array(
105 'type' => 'datetime', // This creates a datetime format not date
106 'not null' => FALSE,
107 ),
108 'deathplace' => array(
109 'type' => 'varchar',
110 'length' => 128,
111 'not null' => FALSE,
112 'default' => 'Unknown',
113 ),
114 'children_num' => array(
115 'type' => 'int',
116 'unsigned' => TRUE,
117 'not null' => FALSE,
118 'default' => 0
119 ),
120 'ancestor_group' => array(
121 'type' => 'varchar',
122 'length' => 128,
123 'not null' => FALSE,
124 'default' => 'Unknown',
125 ),
126 'media' => array(
127 'type' => 'varchar',
128 'length' => 128,
129 'not null' => FALSE,
130 'default' => 'None',
131 ),
132 'privacy' => array(
133 'type' => 'int', // Was SET but doesn't nessacerily need to be changed
134 'unsigned' => TRUE,
135 'not null' => TRUE,
136 'default' => 0
137 ),
138 ),
139 'indexes' => array(
140 'nid' => array('nid'),
141 ),
142 'unique keys' => array(
143 'nid_vid' => array('nid', 'vid'),
144 'vid' => array('vid')
145 ),
146 'primary key' => array('nid'),
147 );
148 $schema['family_group'] = array(
149 'fields' => array(
150 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
151 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
152 'title_format' => array(
153 'type' => 'varchar',
154 'length' => 128,
155 'not null' => FALSE,
156 ),
157 'marr_type' => array(
158 'type' => 'varchar', // Needs to be changed to SET
159 'length' => 128,
160 'not null' => FALSE,
161 'default' => 'Unknown',
162 ),
163 'marr_date' => array(
164 'type' => 'datetime', // This creates a datetime format not date
165 'not null' => FALSE,
166 ),
167 'marr_plac' => array(
168 'type' => 'varchar',
169 'length' => 128,
170 'not null' => FALSE,
171 'default' => 'Unknown',
172 ),
173 'div_date' => array(
174 'type' => 'datetime', // This creates a datetime format not date
175 'not null' => FALSE,
176 ),
177 'div_plac' => array(
178 'type' => 'varchar',
179 'length' => 128,
180 'not null' => FALSE,
181 'default' => 'Unknown',
182 ),
183 'parent1' => array(
184 'type' => 'varchar',
185 'length' => 128,
186 'not null' => FALSE,
187 'default' => 'Unknown',
188 ),
189 'parent2' => array(
190 'type' => 'varchar',
191 'length' => 128,
192 'not null' => FALSE,
193 'default' => 'Unknown',
194 ),
195 'media' => array(
196 'type' => 'varchar',
197 'length' => 128,
198 'not null' => FALSE,
199 'default' => 'None',
200 ),
201 ),
202 'indexes' => array(
203 'nid' => array('nid'),
204 ),
205 'unique keys' => array(
206 'nid_vid' => array('nid', 'vid'),
207 'vid' => array('vid')
208 ),
209 'primary key' => array('nid'),
210 );
211 $schema['family_location'] = array(
212 'fields' => array(
213 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
214 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
215 'title_format' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
216 'building' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
217 'street' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE, 'default' => 'Unknown'),
218 'city' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE, 'default' => 'Unknown'),
219 'county' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
220 'state_province' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
221 'country' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE, 'default' => 'Unknown'),
222 'related_group' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE),
223 'media' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE, 'default' => 'None'),
224 ),
225 'indexes' => array(
226 'nid' => array('nid'),
227 ),
228 'unique keys' => array(
229 'nid_vid' => array('nid', 'vid'),
230 'vid' => array('vid')
231 ),
232 'primary key' => array('nid'),
233
234 );
235 $schema['family_variable'] = array(
236 'fields' => array(
237 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE),
238 'variable' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
239 ),
240 'primary key' => array('name'),
241
242 );
243
244 return $schema;
245 }
246
247 function family_uninstall() {
248 // Remove tables.
249 drupal_uninstall_schema('family');
250 }

  ViewVC Help
Powered by ViewVC 1.1.2