· 8 years ago · Mar 20, 2018, 06:14 PM
1{
2 "formatVersion": 1,
3 "database": {
4 "version": 1,
5 "identityHash": "3a866c910b5767d70216e5739d38d72d",
6 "entities": [
7 {
8 "tableName": "plants2",
9 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`plant_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `environment_id_pk` INTEGER NOT NULL, `plant_name` TEXT, `strain` TEXT, `breeder` TEXT, `img_location` TEXT, `flower_period_days` INTEGER NOT NULL, `genus` TEXT, `seed_type` TEXT, `grow_medium` TEXT, `life_stage` TEXT, `germination_date` TEXT, `veg_date` TEXT, `flower_date` TEXT, `created_at` TEXT, `updated_at` TEXT, `plant_notes` TEXT, `container_id` INTEGER NOT NULL, FOREIGN KEY(`environment_id_pk`) REFERENCES `environments`(`environment_id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
10 "fields": [
11 {
12 "fieldPath": "plantId",
13 "columnName": "plant_id",
14 "affinity": "INTEGER",
15 "notNull": true
16 },
17 {
18 "fieldPath": "environmentId",
19 "columnName": "environment_id_pk",
20 "affinity": "INTEGER",
21 "notNull": true
22 },
23 {
24 "fieldPath": "plantName",
25 "columnName": "plant_name",
26 "affinity": "TEXT",
27 "notNull": false
28 },
29 {
30 "fieldPath": "strain",
31 "columnName": "strain",
32 "affinity": "TEXT",
33 "notNull": false
34 },
35 {
36 "fieldPath": "breeder",
37 "columnName": "breeder",
38 "affinity": "TEXT",
39 "notNull": false
40 },
41 {
42 "fieldPath": "imageLocation",
43 "columnName": "img_location",
44 "affinity": "TEXT",
45 "notNull": false
46 },
47 {
48 "fieldPath": "flowerPeriodDays",
49 "columnName": "flower_period_days",
50 "affinity": "INTEGER",
51 "notNull": true
52 },
53 {
54 "fieldPath": "genus",
55 "columnName": "genus",
56 "affinity": "TEXT",
57 "notNull": false
58 },
59 {
60 "fieldPath": "seedType",
61 "columnName": "seed_type",
62 "affinity": "TEXT",
63 "notNull": false
64 },
65 {
66 "fieldPath": "medium",
67 "columnName": "grow_medium",
68 "affinity": "TEXT",
69 "notNull": false
70 },
71 {
72 "fieldPath": "lifeStage",
73 "columnName": "life_stage",
74 "affinity": "TEXT",
75 "notNull": false
76 },
77 {
78 "fieldPath": "germinationDate",
79 "columnName": "germination_date",
80 "affinity": "TEXT",
81 "notNull": false
82 },
83 {
84 "fieldPath": "vegDate",
85 "columnName": "veg_date",
86 "affinity": "TEXT",
87 "notNull": false
88 },
89 {
90 "fieldPath": "flowerDate",
91 "columnName": "flower_date",
92 "affinity": "TEXT",
93 "notNull": false
94 },
95 {
96 "fieldPath": "createdAt",
97 "columnName": "created_at",
98 "affinity": "TEXT",
99 "notNull": false
100 },
101 {
102 "fieldPath": "updatedAt",
103 "columnName": "updated_at",
104 "affinity": "TEXT",
105 "notNull": false
106 },
107 {
108 "fieldPath": "notes",
109 "columnName": "plant_notes",
110 "affinity": "TEXT",
111 "notNull": false
112 },
113 {
114 "fieldPath": "containerId",
115 "columnName": "container_id",
116 "affinity": "INTEGER",
117 "notNull": true
118 }
119 ],
120 "primaryKey": {
121 "columnNames": [
122 "plant_id"
123 ],
124 "autoGenerate": true
125 },
126 "indices": [],
127 "foreignKeys": [
128 {
129 "table": "environments",
130 "onDelete": "NO ACTION",
131 "onUpdate": "NO ACTION",
132 "columns": [
133 "environment_id_pk"
134 ],
135 "referencedColumns": [
136 "environment_id"
137 ]
138 }
139 ]
140 },
141 {
142 "tableName": "waterings",
143 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `ph` REAL NOT NULL, `plantId` INTEGER NOT NULL, `strength` REAL NOT NULL, `gallons` REAL NOT NULL, `notes` TEXT, `watered_at` TEXT, `created_at` TEXT, `updated_at` TEXT)",
144 "fields": [
145 {
146 "fieldPath": "id",
147 "columnName": "id",
148 "affinity": "INTEGER",
149 "notNull": true
150 },
151 {
152 "fieldPath": "ph",
153 "columnName": "ph",
154 "affinity": "REAL",
155 "notNull": true
156 },
157 {
158 "fieldPath": "plantId",
159 "columnName": "plantId",
160 "affinity": "INTEGER",
161 "notNull": true
162 },
163 {
164 "fieldPath": "strength",
165 "columnName": "strength",
166 "affinity": "REAL",
167 "notNull": true
168 },
169 {
170 "fieldPath": "gallons",
171 "columnName": "gallons",
172 "affinity": "REAL",
173 "notNull": true
174 },
175 {
176 "fieldPath": "notes",
177 "columnName": "notes",
178 "affinity": "TEXT",
179 "notNull": false
180 },
181 {
182 "fieldPath": "wateredAt",
183 "columnName": "watered_at",
184 "affinity": "TEXT",
185 "notNull": false
186 },
187 {
188 "fieldPath": "createdAt",
189 "columnName": "created_at",
190 "affinity": "TEXT",
191 "notNull": false
192 },
193 {
194 "fieldPath": "updatedAt",
195 "columnName": "updated_at",
196 "affinity": "TEXT",
197 "notNull": false
198 }
199 ],
200 "primaryKey": {
201 "columnNames": [
202 "id"
203 ],
204 "autoGenerate": true
205 },
206 "indices": [],
207 "foreignKeys": []
208 },
209 {
210 "tableName": "notes",
211 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `note` TEXT, `entry_id` INTEGER NOT NULL, `created_at` TEXT, `updated_at` TEXT, FOREIGN KEY(`entry_id`) REFERENCES `entries`(`entry_id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
212 "fields": [
213 {
214 "fieldPath": "id",
215 "columnName": "id",
216 "affinity": "INTEGER",
217 "notNull": true
218 },
219 {
220 "fieldPath": "note",
221 "columnName": "note",
222 "affinity": "TEXT",
223 "notNull": false
224 },
225 {
226 "fieldPath": "entry_id",
227 "columnName": "entry_id",
228 "affinity": "INTEGER",
229 "notNull": true
230 },
231 {
232 "fieldPath": "createdAt",
233 "columnName": "created_at",
234 "affinity": "TEXT",
235 "notNull": false
236 },
237 {
238 "fieldPath": "updatedAt",
239 "columnName": "updated_at",
240 "affinity": "TEXT",
241 "notNull": false
242 }
243 ],
244 "primaryKey": {
245 "columnNames": [
246 "id"
247 ],
248 "autoGenerate": true
249 },
250 "indices": [],
251 "foreignKeys": [
252 {
253 "table": "entries",
254 "onDelete": "CASCADE",
255 "onUpdate": "NO ACTION",
256 "columns": [
257 "entry_id"
258 ],
259 "referencedColumns": [
260 "entry_id"
261 ]
262 }
263 ]
264 },
265 {
266 "tableName": "entries",
267 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`entry_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
268 "fields": [
269 {
270 "fieldPath": "entryId",
271 "columnName": "entry_id",
272 "affinity": "INTEGER",
273 "notNull": true
274 }
275 ],
276 "primaryKey": {
277 "columnNames": [
278 "entry_id"
279 ],
280 "autoGenerate": true
281 },
282 "indices": [],
283 "foreignKeys": []
284 },
285 {
286 "tableName": "environments",
287 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`environment_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `environment_name` TEXT, `light_type` TEXT, `light_color` INTEGER NOT NULL, `light_watts` INTEGER NOT NULL, `hours_on` INTEGER NOT NULL, `environment_notes` TEXT, `create_at` TEXT, `updated_at` TEXT)",
288 "fields": [
289 {
290 "fieldPath": "environmentId",
291 "columnName": "environment_id",
292 "affinity": "INTEGER",
293 "notNull": true
294 },
295 {
296 "fieldPath": "environmentName",
297 "columnName": "environment_name",
298 "affinity": "TEXT",
299 "notNull": false
300 },
301 {
302 "fieldPath": "lightType",
303 "columnName": "light_type",
304 "affinity": "TEXT",
305 "notNull": false
306 },
307 {
308 "fieldPath": "lightColor",
309 "columnName": "light_color",
310 "affinity": "INTEGER",
311 "notNull": true
312 },
313 {
314 "fieldPath": "lightWatts",
315 "columnName": "light_watts",
316 "affinity": "INTEGER",
317 "notNull": true
318 },
319 {
320 "fieldPath": "lightHoursOn",
321 "columnName": "hours_on",
322 "affinity": "INTEGER",
323 "notNull": true
324 },
325 {
326 "fieldPath": "notes",
327 "columnName": "environment_notes",
328 "affinity": "TEXT",
329 "notNull": false
330 },
331 {
332 "fieldPath": "createdAt",
333 "columnName": "create_at",
334 "affinity": "TEXT",
335 "notNull": false
336 },
337 {
338 "fieldPath": "updatedAt",
339 "columnName": "updated_at",
340 "affinity": "TEXT",
341 "notNull": false
342 }
343 ],
344 "primaryKey": {
345 "columnNames": [
346 "environment_id"
347 ],
348 "autoGenerate": true
349 },
350 "indices": [],
351 "foreignKeys": []
352 },
353 {
354 "tableName": "containers",
355 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT, `size` REAL NOT NULL, `substrate` TEXT)",
356 "fields": [
357 {
358 "fieldPath": "id",
359 "columnName": "id",
360 "affinity": "INTEGER",
361 "notNull": true
362 },
363 {
364 "fieldPath": "type",
365 "columnName": "type",
366 "affinity": "TEXT",
367 "notNull": false
368 },
369 {
370 "fieldPath": "size",
371 "columnName": "size",
372 "affinity": "REAL",
373 "notNull": true
374 },
375 {
376 "fieldPath": "substrate",
377 "columnName": "substrate",
378 "affinity": "TEXT",
379 "notNull": false
380 }
381 ],
382 "primaryKey": {
383 "columnNames": [
384 "id"
385 ],
386 "autoGenerate": true
387 },
388 "indices": [],
389 "foreignKeys": []
390 }
391 ],
392 "setupQueries": [
393 "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
394 "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"3a866c910b5767d70216e5739d38d72d\")"
395 ]
396 }
397}