Project

General

Profile

« Previous | Next » 

Revision 11601

bugfix: inputs/VegBank/: need to remove inter-datasource duplicates from plot instead of the left-joined plot_ table, because the fkeys needed to do the cascading deletes are all to the plot table. this requires doing the column-renaming and postprocessing on plot before it's left-joined.

View differences:

create.sql
4 4
    FROM place
5 5
    JOIN namedplace USING (namedplace_id)
6 6
    WHERE
7
    place.plot_id = plot.plot_id
7
    place.plot_id = plot."locationID"
8 8
    AND placesystem = 'continent'
9 9
    LIMIT 1
10 10
    ) AS continent
......
12 12
    FROM place
13 13
    JOIN namedplace USING (namedplace_id)
14 14
    WHERE
15
    place.plot_id = plot.plot_id
15
    place.plot_id = plot."locationID"
16 16
    AND placesystem = 'area|country|territory'
17 17
    LIMIT 1
18 18
    ) AS "area|country|territory"
......
20 20
    FROM place
21 21
    JOIN namedplace USING (namedplace_id)
22 22
    WHERE
23
    place.plot_id = plot.plot_id
23
    place.plot_id = plot."locationID"
24 24
    AND placesystem = 'region|state|province'
25 25
    LIMIT 1
26 26
    ) AS "region|state|province"
......
28 28
    FROM place
29 29
    JOIN namedplace USING (namedplace_id)
30 30
    WHERE
31
    place.plot_id = plot.plot_id
31
    place.plot_id = plot."locationID"
32 32
    AND placesystem = 'county'
33 33
    LIMIT 1
34 34
    ) AS county
......
36 36
    FROM place
37 37
    JOIN namedplace USING (namedplace_id)
38 38
    WHERE
39
    place.plot_id = plot.plot_id
39
    place.plot_id = plot."locationID"
40 40
    AND placesystem = 'quadrangle'
41 41
    LIMIT 1
42 42
    ) AS quadrangle
......
44 44
    FROM place
45 45
    JOIN namedplace USING (namedplace_id)
46 46
    WHERE
47
    place.plot_id = plot.plot_id
47
    place.plot_id = plot."locationID"
48 48
    AND placesystem = 'Geographic Name'
49 49
    LIMIT 1
50 50
    ) AS "Geographic Name"

Also available in: Unified diff